Stocks rose after the White House delayed imposing tariffs on some consumer and electronic goods imported from China that were set to go into effect on Sept. 1.

The delay, the latest twist in the on-again off-again trade war between the world’s two largest economies, pushed shares of retailers, computer-chip makers and other technology firms sharply higher. The S&P 500 index rose 1.5 percent, recovering from a 1.2 percent drop on Monday.

Investors have been unnerved recently by indications that the trade war between the United States and China was worsening quickly, so the signs of easing tension were seen as a relief.

The United States trade representative’s office said that a new 10 percent tariff on roughly half the Chinese goods exported to the United States would still take effect on Sept. 1 as announced by President Trump.