Investors breathed a sigh of relief Friday that President Trump’s blistering critique of China’s crackdown on Hong Kong dissidents did not include a threat to blow up U.S.-Chinese trade, propelling the three major U.S. indexes to their second consecutive month in the plus column.

The Dow Jones industrial average ended Friday at 25,383.11, about even on the day, after plunging as much as 300 points on fears of a U.S.-China trade frost. The political fallout over the novel coronavirus has sparked a broader power struggle between Beijing and Washington on trade, finance and the fate of Hong Kong.

Trump did not impose new tariffs or cancel the phase one trade deal the two nations signed earlier this year, as some investors had feared, during his Friday news conference. Nor did he mention China’s failure to quickly increase purchases of American goods as required by the trade deal.

“The market does not want to see these trade tensions flare up,” said Scott Wren of Wells Fargo Investment Institute. “We’ve got enough to worry with the coronavirus, so the last thing the market wants is an economic cold war with China.”

The Dow closes out May with a 4 percent advance. The blue-chip index is 36 percent higher than its March 23 low and 14 percent off its all-time high. It is down 11 percent in 2020.

The Standard & Poor’s 500 finished the session with a modest gain, closing up 15 points or 0.5 percent, to finish at 3,044.31. The broad index expanded 4 percent during the month and is 36 percent above its March 23 bottom.

“On the heels of April’s 12.8 percent gains including dividends, the S&P 500 produced a total return of around 4 percent in May,” said Michael Farr, president of investment firm Farr, Miller & Washington. “The S&P is now down 5.5 percent for the year in the midst of the pandemic. That’s amazing.”

The Nasdaq composite, stacked with highflying technology stocks, held its ground Friday as investors piled into Amazon, Microsoft, Apple and Alphabet, which have become more integral to the new economy. (Amazon CEO Jeff Bezos owns The Washington Post.) The Nasdaq is up 4.4 percent in 2020 after its 121-point, or 1.3 percent, advance pushed it to 9,489.87 on Friday.

“The technology sector was a standout for the month, and is now positive for the year,” said Howard Silverblatt of S&P Dow Jones Indices. “Consumer discretionary is also up for the year. Investors think people are spending and going to spend more in the coming months, especially when they get that second stimulus check.”

May was defined by grim and occasionally conflicting reports on the financial and scientific fronts. Stocks would skyrocket one day on word of an advance on a coronavirus vaccine candidate, only to deflate the next on a disappointing economic data point.

Consumer spending, which drives two-thirds of the U.S. economy, plunged a record 13.6 percent in April; its worst decline since the Commerce Department began keeping records in 1959. Unemployment spiked to 14.7 percent as pandemic-era layoffs swelled past 40 million, though it also showed signs of bottoming out. Personal income and demand for new mortgages rose more than expected.

And though states and communities continued to ease the restrictions that shuttered nonessential businesses, several prominent retailers headed to bankruptcy court in May. Discount retailer Tuesday Morning filed for Chapter 11 protection on Wednesday, following J.C. Penney, Stage Stores, Nieman Marcus and J. Crew. Pier 1, which filed for bankruptcy before the pandemic, announced it would liquidate its business.

Oil prices had their best month in history, rallying off from their April depths due to a steady rebound in demand for refined products such as gasoline as countries and states reopen.

U.S. benchmark West Texas Intermediate rose 90 percent in May, aided by a slash in domestic output of 2 million barrels from the 13 million barrels U.S. producers were pumping in late March. The per barrel price is still only half of what it was in January, before the virus shut down automobile travel and airlines.

“The U.S. oil rig count has fallen to nearly an all-time low, and OPEC members, along with Russia and others, have cut output drastically,” said John Kilduff of Again Capital. “There is a lot of pent up demand that has worked its way into the market.”

U.S. producers have led the way in engineering the price recovery this month, slashing output by nearly 2 million barrels per day, just since the third week in March.