A woman walks past an electronic display showing stock market information in Hong Kong on Monday. (Jerome Favre/EPA-EFE/REX/Shutterstock)

Wall Street cut early losses Monday to eke out a small gain, as investors balanced the nation’s first steps toward reopening against rising U.S.-China tensions over the origins of the coronavirus.

Secretary of State Mike Pompeo said Sunday there was “enormous evidence” that the virus had come from a lab in China, though that pronouncement conflicts with growing scientific evidence that it is the result of a “natural process.” President Trump is said to be intent on retaliation through new tariffs.

“Punishing China is definitely where the president’s head is at right now,” one senior adviser told The Washington Post last week.

The Dow Jones industrial average edged up 26 points, or 0.1 percent, to close at 23,749.76 after being down as much as 362 points. The Standard & Poor’s 500-stock index gained 12 points, or 0.4 percent, to settle at 2,842.74. The tech-heavy Nasdaq composite index jumped 106 points, or 1.2 percent, to end at 8,710.71.

Airline stocks tumbled after Warren Buffett announced that Berkshire Hathaway had sold all its airline holdings because of the outbreak. United Airlines plunged 10 percent, American Airlines skidded more than 11.4 percent, and Southwest slid 6.5 percent.

“The world has changed for the airlines, and I don’t know how it’s changed, and I hope it corrects itself in a reasonably prompt way,” Buffett said at Berkshire Hathaway’s annual investors’ meeting. “I don’t know if Americans have now changed their habits or will change their habits because of the extended period.”

But investors rallied around tech, with Microsoft surging 2.5 percent, Facebook climbing 1.5 percent and Apple jumping more than 1.4 percent. Oil prices climbed, with the U.S. benchmark West Texas intermediate crude jumping 7 percent to $21.16 a barrel.

Global markets traded lower on U.S.-China worries. The German DAX gave back 3.5 percent, the French CAC plunged 4.2 percent, and the Pan-European Stoxx 600 fell 2.7 percent. The Hang Seng in Hong Kong plunged 4.1 percent. Markets in Japan and China were closed for holidays.

April marked Wall Street’s best month in 33 years, with the S&P 500 surging 12.7 percent, despite a rash of dismal economic developments. Economic output slumped 4.8 percent in the first quarter, and more than 30 million Americans lost their jobs within weeks of the pandemic’s arrival, pushing the U.S. unemployment rate toward Great Depression levels.

Market analysts are closely watching consumer behavior during this first week of May as some states begin slowly opening their economies, many against the recommendations of public health experts. Twenty-four states are partially reopening this week as stay-at-home orders expire and governors allow certain retail establishments, including restaurants, to resume service.

Trump has backed protesters in other states who have swarmed state capitals — often armed with rifles — with calls to “liberate” those states.

Preppy fashion retailer J. Crew was the latest corporate victim to fall. It filed for Chapter 11 bankruptcy protection early Monday and will convert $1.65 billion worth of debt into equity.

“If the economy fell this hard in the first quarter, with less than a month of pandemic lockdown for most states,” said Chris Rupkey of MUFG Bank, “don’t ask how far it will crater in the second quarter, because it is going to be a complete disaster.”