According to analysts at Wells Fargo, the dollar will fall as the US economy gets into a recession and the Fed has to cut interest rates.

The dollar has surged this year as the Fed hiked rates harder than other central banks. The dollar is seen as a safe-haven asset due to doubts about the global economy.

The economists at Wells Fargo told clients in a note that they expect the dollar to keep rising. They think the Fed will hike interest rates by 75 basis points in September, which will further increase the value of the US dollar.

The dollar could peak in the fourth quarter before falling against other global currencies, according to them.

Inflation and rate hikes will cause the US to fall into a recession early in the next decade, according to Wells Fargo. The Fed will begin to cut rates again at the end of the year if there is a sharp slowdown.

"As those rate cuts are signaled, priced and implemented, we expect the US dollar to trend lower over the course of the next decade," the economists said.

As the Fed pulls back, they see a narrowing of the interest rate gap.

They said that with interest rate differentials swinging back in favor of foreign currencies next year, the greenback should enter a period of decline.

The euro is expected to fall to $0.96 in the fourth quarter as the dollar strengthens, according to Wells Fargo. The euro is expected to rise to $1.02 by the end of the year.

The dollar index is up more than 12% this year as the Fed has hiked rates at a faster pace than in the past. It wasn't much different at 108.6 on Wednesday, not far off a 20-year high.

A strong dollar lowers the cost of imports into the US. It piles the pressure on foreign countries by increasing the cost of servicing their dollar debts and reduces the value of their currency.