Stocks jumped on Tuesday, rebounding from their biggest loss in more than four months and giving investors a reprieve from the waves of selling that have characterized trading so far in May.

Investors are trying to adjust to the ratcheting up of trade tension between the United States and China, and assess the impact of the continuing dispute on the global economy, corporate profits and consumer spending. It is an abrupt change for traders who, as recently as last month, were anticipating that the two sides were close to reaching a deal.

On Monday, the S&P 500 suffered its steepest drop since early January, after Beijing said it would raise tariffs on American-made goods in retaliation for a similar move from the United States.

Stocks on Tuesday rebounded from that plunge. The S&P rose 0.8 percent, while European markets were also higher. Asian stock markets had ended the day slightly lower.