The gain nudged the& Dow& Jones industrial average slightly above the 18,000-point mark for the first time since last summer, while the Standard & Poor’s 500 index rose to the highest level in a year.
The market had been headed lower early on following news that representatives from several major oil-producing nations meeting over the weekend in Doha, Qatar, failed to hammer out a deal to cut output. That sent the price of U.S. oil down 7 percent at one point before recouping much of its losses. It ended down 1.4 percent.
The& Dow& climbed 106.70 points, or 0.6 percent, to close at 18,004.16. The last time the average was above 18,000 points was on July 20.
The S&P 500 index added 13.61 points, or 0.7 percent, to 2,094.34. That’s the highest level since April 14 last year.
The Nasdaq composite index gained 21.80 points, or 0.4 percent, to 4,960.02.
For the year, the& Dow& is up 3.3 percent, while the S&P 500 is up 2.5 percent. The Nasdaq is down about 1 percent.
All told, U.S. crude fell 58 cents, or 1.4 percent, to close at $39.78 a barrel in New York. Brent crude, the international benchmark, lost 19 cents, or 0.4 percent, to close at $42.91 a barrel in London.
Several energy and drilling services companies rebounded after an early morning sell-off.
Hess rose $2.67, or 4.7 percent, to $59.84, while Marathon Oil added 35 cents, or 2.7 percent, to $13.36. Baker Hughes gained $1.90, or 4.3 percent, to $45.70.
Energy companies notched the biggest gain among the sectors in the S&P 500, rising 1.6 percent. The sector is up 7.7 percent this year.
Stocks in the health care and consumer discretionary sectors also posted big gains.
Endo International led a surge among several pharmaceutical companies. The stock also posted the biggest gain in the S&P 500, vaulting $2.16, or 8.2 percent, to $28.49. Regeneron Pharmaceuticals climbed $15.65, or 3.9 percent, to $422.38.
Major stock indexes in Europe also closed higher.
Germany’s DAX rose 0.7 percent, while the CAC-40 in France edged up 0.3 percent. Britain’s FTSE 100 index was up 0.2 percent.
In Asia, Japan’s Nikkei 225 index dropped 3.4 percent as a rising yen and quake-related production halts added to investor worries. Hong Kong’s Hang Seng index lost 0.7 percent. South Korea’s Kospi slid 0.3 percent, while Australia’s S&P/ASX 200 dipped 0.4 percent.
In other energy trading, wholesale gasoline fell about 2 cents to $1.44 a gallon. Heating oil was little changed at $1.24 a gallon. Natural gas rose 3.8 cents, or 2 percent, to $1.94 per 1,000 cubic feet.
Precious and industrial metals futures ended narrowly mixed. Gold edged up 40 cents to $1,235 an ounce, silver slipped six cents to $16.25 an ounce and copper edged up a penny to $2.16 a pound.
Bond prices fell. The yield on the 10-year Treasury note rose to 1.77 percent from 1.75 late Friday. In currency markets, the dollar rose to 108.82 yen from 108.70 yen. The euro rose to $1.1314 from $1.1288.