The Standard & Poor’s 500 index and the& Dow& Jones industrial average each eked out a tiny gain, while the Nasdaq composite ended slightly lower.
Consumer staples stocks were among the biggest gainers. Oil and gas companies were hit by another plunge the price of crude oil, which tumbled 5.3 percent to a 12-year low. Chevron lost 1.7 percent and Exxon Mobil fell 1 percent.
The latest downturn in oil comes at a time when investors are increasingly uneasy about the trajectory of China’s economy and the possible implications for U.S. company earnings. China’s Shanghai composite fell 5.3 percent on Monday.
The& Dow& added 52.12 points, or 0.3 percent, to 16,398.57. The S&P 500 index rose 1.64 points, or 0.1 percent, to 1,923.67. The Nasdaq fell 5.64 points, or 0.1 percent, to 4,637.99.
All of the major stock indexes are down sharply for the year.
The three indexes hinted at a rebound early Monday, but spent much of the day in the red as investors weighed the implications of another stock market drop in China and the slide in crude. The market appeared headed for a lower close until the final minutes of regular trading, when the& Dow& and S&P 500 index shifted back into positive territory.
On Monday, Benchmark U.S. crude dropped $1.75, or 5.3 percent, to $31.41 a barrel in New York. Brent crude, a benchmark for international oils, fell $2, or 6 percent, to $31.55 a barrel in London.
Several energy and mining companies slumped as crude oil and other commodity prices fell.
Chevron slid $1.36, or 1.7 percent, to $80.77, while Exxon Mobil lost $1, or 1.3 percent, to $73.69.
All told, energy stocks fell the most among companies in the S&P 500 index, 2.1 percent. The sector is down 8.8 percent this year. That’s on top of a loss of 24 percent for 2015.
Consumer staples stocks led the risers pack, adding about 1 percent. Macy’s notched the biggest gain in the index, adding $2.93, or 8.2 percent, to $38.82.
HCA Holdings also rose after the hospital operator raised its profit forecast. The stock added $3.56, or 5.5 percent to $67.83.
European markets were down. Germany’s DAX slipped 0.2 percent, while the CAC-40 in France lost 0.5 percent. The FTSE 100 index of leading British shares slid 0.7 percent.
In Asia, Chinese stocks sank again after a rebound Friday that analysts suggested was due to buying from a group of state entities dubbed the “National Team.” The Shanghai Composite Index fell 5.3 percent and Hong Kong’s Hang Seng sank 2.8 percent.
Gold fell $1.70 to $1,096.20 an ounce, while silver fell 5 cents to $13.86 an ounce. Copper slipped 5 cents, or 2.4 percent, to $1.97 a pound.
Bond prices fell. The yield on the 10-year Treasury note rose to 2.18 percent from 2.12 percent late Friday.
The euro fell to $1.0856 from $1.0903 and the dollar edged down to 117.74 yen compared with 117.67 yen late Friday.
In other energy trading in New York, wholesale gasoline fell 1.5 cents to $1.113 a gallon, heating oil fell 3.7 cents to $1.015 a gallon and natural gas lost 7.6 cents to $2.396 per 1,000 cubic feet.