NEW YORK — U.S. stocks soared to one of their best days in history Wednesday on a euphoric Wall Street after President Donald Trump said he would back off on most of his tariffs temporarily.

The S&P 500 surged 9.5 percent, an amount that would count as a good year for the market. It had been sinking earlier in the day on worries that Trump’s trade war could drag the global economy into a recession. But then came the posting on social media that investors worldwide had been waiting and wishing for.

“I have authorized a 90 day PAUSE,” Trump posted, after recognizing the more than 75 countries that he said have been negotiating on trade and had not retaliated against his latest increases in tariffs.

Treasury Secretary Scott Bessent later told reporters that Trump was pausing his “reciprocal” tariffs on most of the country’s biggest trading partners, but maintaining his 10 percent tariff on nearly all global imports.

China was a huge exception, though, with Trump saying tariffs are going up to 125 percent against its products.

The focus Wednesday, however, was on the positive. The Dow Jones Industrial Average shot to a gain of 2,962 points, or 7.9 percent. The Nasdaq composite leaped 12.2 percent. The S&P 500 had its third-best day since 1940.

The S&P 500, the index that sits at the center of many 401(k) accounts, came into the day nearly 19 percent below its record set less than two months ago.

Wednesday’s rally pulled the S&P 500 index away from the edge of what’s called a “bear market.” That’s what professionals call it when a run-of-the-mill drop of 10 percent for U.S. stocks, which happens every year or so, graduates into a more vicious fall of 20 percent. The index is now down 11.2 percent from its record.

Boost from Treasurys

Wall Street also got a boost from a relatively smooth auction of U.S. Treasurys in the bond market Wednesday. Earlier jumps in Treasury yields had rattled the market, indicating increasing levels of stress. Trump himself said Wednesday that he had been watching the bond market “getting a little queasy.”

Analysts say several reasons could be behind the rise in yields, including hedge funds and other investors having to sell their Treasury bonds to raise cash in order to make up for losses in the stock market.

Investors outside the United States may also be selling their U.S. Treasurys because of the trade war. Such actions would push down prices for Treasurys, which in turn would push up their yields.

Regardless of the reasons behind it, higher yields on Treasurys add pressure on the stock market and push upward on rates for mortgages and other loans for U.S. households and businesses.

The moves are particularly notable because U.S. Treasury yields have historically dropped — not risen — during scary times for the market because the bonds are usually seen as some of the safest possible investments. This week’s sharp rise had brought the yield on the 10-year Treasury back to where it was in late February.

After approaching 4.50 percent in the morning, the 10-year yield pulled back to 4.34 percent following Trump’s pause and the Treasury’s auction. That’s still up from 4.26 percent late Tuesday and from just 4.01 percent at the end of last week.

Market’s best days are often near worst days

Wednesday’s rally provided the latest reminder that some of the U.S. stock market’s best days have been clustered around some of its worst days historically. That’s one of the reasons many financial advisers suggest not trying to time the market and selling stocks and other investments meant for the long term when nervous, because of the risk of missing out on such huge up days.

The biggest gain for the S&P 500 since World War II was an 11.6 percent surge on Oct. 13, 2008, for example. That was during the depths of the Great Recession, when worries were high that the financial system was collapsing and the S&P 500 was in the midst of a nearly 57 percent plunge from its peak in late 2007 until its bottom in March 2009. A couple weeks later, the index had another one of its best days in history, soaring 10.8 percent.

Wednesday’s gains were widespread across the U.S. stock market, and 98 percent of the stocks in the S&P 500 index rallied.

Leading the way were airlines and other stocks that need customers feeling confident enough to travel for work or for vacation.

Delta Air Lines soared 23.4 percent. Earlier in the day, it had pulled financial forecasts for 2025 as the trade war scrambles expectations for business and household spending and depresses bookings across the travel sector. All told, the S&P 500 rocketed higher by 474.13 points to 5,456.90. The Dow Jones Industrial gained 2,962.86 to 40,608.45, and the Nasdaq composite surged 1,857.06 to 17,124.97.

Overseas indexes fell

In stock markets abroad, indexes tumbled across most of Europe and much of Asia after they closed before Trump’s announcement.

London’s FTSE 100 dropped 2.9 percent, Tokyo’s Nikkei 225 sank 3.9 percent and the CAC 40 fell 3.3 percent in Paris. Chinese stocks were an outlier, and indexes rose 0.7 percent in Hong Kong and 1.3 percent in Shanghai.

After Trump’s announcement, Asian shares surged in early Thursday trading, with Japan’s benchmark jumping more than 2,000 points almost immediately after the Tokyo exchange opened.

On Thursday, Japan’s benchmark Nikkei 225 jumped 8.8 percent in morning trading to 34,510.86, zooming upward as soon as trading began. Australia’s S&P/ASX 200 soared 5.1 percent to 7,748.00. South Korea’s Kospi gained 5.2 percent to 2,412.80.