The United States is missing out on a major tourism boom.

The number of trips made by global travelers surged 7% last year, according to new projections from the UN World Tourism Organization (UNWTO). Meanwhile, trips to the U.S. fell by about 4%.

The decline, which follows a 2% drop in 2016, allowed Spain to overtake the U.S. as the second-most visited country in the world. Spain welcomed an estimated 82 million visitors last year, up 9% from 2016. The number of trips to the U.S. was roughly 73 million.

France remains the world's favorite tourist destination, with traveler numbers surging about 8% to roughly 89 million.

Industry experts said that two key factors were behind the decline in U.S. tourism: The strong dollar and controversial policies on immigration and travel introduced by President Trump's administration.

"The deterioration in demand from key markets such as the U.K. and Mexico can be attributable to the less desirable image of the U.S. under Trump following controversial decisions such as the travel ban," said tourism analysts at Euromonitor. "But also the strong dollar [acted] as a deterrent, coupled with the current less stable political situation."

The dollar surged to multi-year highs at the start of 2017 versus other global currencies. This made it less affordable for travelers to stay in the U.S., even though the dollar weakened over the course of the year.

Related: Trump takes credit for 2017 air safety

The U.S. Travel Association said last week that it has seen a drop in tourist spending. It estimated that this cost the U.S. economy $4.6 billion in the first 11 months of 2017.

"After almost a decade and a half of relatively sustained post-9/11 recovery, since 2015 there's been evidence that the country has gotten complacent with the policies needed to support this vital economic engine and job creator," warned Roger Dow, the association's CEO.

"Our guiding principle is that we can have strong national security and still welcome legitimate international visitors," he said.

Related: Air travel to China is about to get more expensive

While the U.S. suffered, tourism to European destinations flourished.

"Europe recorded extraordinary results for such a large and rather mature region, with 8% more international arrivals than in 2016," said the UNWTO.

Southern European and Mediterranean destinations in particular saw a 13% surge in visitors. This prompted some communities to introduce new rules to curb tourism levels and shield locals from the impact of large numbers of visitors.

America's neighbors also recorded growth in tourist arrivals: Mexico welcomed 12% more visitors and Canadians arrivals were up 4%. This was "driven by increasing demand from the United States," said the UNWTO.

Related: Airbus wins sales race with Boeing for 5th straight year

Forecasts for global tourism in 2018 are upbeat, with expectations that the industry will grow between 4% and 5%.

"The current strong momentum is expected to continue in 2018, though at a more sustainable pace after eight years of steady expansion following the 2009 economic and financial crisis," said the UNWTO.

Travel intelligence firm ForwardKeys summed up the forecast like this: "A very bright outlook generally, with the exception of the USA."