NEW YORK >> Stocks rallied Monday after China and the United States announced a 90-day truce in their trade war. Each of the world’s two largest economies agreed to take down temporarily most of its tariffs against the other, which economists had warned could start a recession and create shortages on U.S. store shelves.

The S&P 500 shot up 3.3% to pull back within 5% of its all-time high set in February. It’s been roaring higher since falling nearly 20% below the mark last month on hopes that President Donald Trump will lower his tariffs after reaching trade deals with other countries. The index at the heart of many 401(k) accounts is back above where it was April 2, Trump’s “Liberation Day,” when he announced stiff worldwide tariffs that ignited worries about a potentially self-inflicted recession.

The Dow Jones Industrial Average jumped 1,160 points, or 2.8%, and the Nasdaq composite climbed 4.3%.

It wasn’t just stocks rising following what one analyst called a “best case scenario” for US-China tariff talks, which reduced tariffs by more than what many investors expected.

Crude oil prices climbed because a global economy less burdened by tariffs will likely burn more fuel. The value of the U.S. dollar strengthened against everything from the euro to the Japanese yen to the Swiss franc. And Treasury yields jumped on expectations that the Federal Reserve won’t have to cut interest rates as deeply this year as earlier expected in order to protect the economy from the damage of tariffs.

Gold’s price fell, meanwhile, as investors felt less need to buy something safe.

The move announced Monday could add 0.4 percentage points to the U.S. economy’s growth this year, according to Jonathan Pingle, U.S. chief economist at UBS. That’s a significant chunk, and every bit counts when the U.S. economy shrank at a 0.3% annual rate in the first three months of the year.

The United States said in a joint statement that it will cut tariffs on Chinese goods to 30% from as high as 145%. China, meanwhile, said its tariffs on U.S. goods will fall to 10% from 125%. The 90-day pause gives time for more talks following the weekend’s negotiations in Geneva, Switzerland, which the U.S. side said yielded “substantial progress.”

The 90-day reprieve also comes at a vital time for the economy, allowing retailers and suppliers to “ensure that shelves are stocked for the all important back-to-school and holiday shopping seasons,” said Carol Schleif, chief market strategist at BMO Private Wealth.