Energy companies led a broad rally in US stocks on Monday as investors shrugged off another slide in crude oil prices.
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 US oil down 7% at one point before recouping much of its losses. It ended down 1.4%.
The Dow climbed 106.70 points, or 0.6%, 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%, 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%, to 4,960.02.
For the year, the Dow is up 3.3%, while the S&P 500 is up 2.5%. The Nasdaq is down about 1%.
The price of oil had risen in recent weeks on hopes for a deal that will limit oil production in an effort to relieve a global glut.
But hopes for a meaningful production cut faded on Monday when the talks over the weekend failed to deliver a deal.
Saudi Arabia said it wouldn't back a deal if Iran, which is trying to ramp up output as international sanctions are lifted, wasn't involved.
Word of the failed talks initially pulled oil prices lower, weighing on stocks.
All told, US crude fell 58 cents, or 1.4%, to close at 39.78 dollars a barrel in New York. Brent crude, the international benchmark, lost 19 cents, or 0.4%, to close at 42.91 dollars a barrel in London.
Hess rose 2.67 dollars, or 4.7% to 59.84 dollars, while Marathon Oil added 35 cents, or 2.7%, to 13.36 dollars.
Energy companies notched the biggest gain among the sectors in the S&P 500, rising 1.6%. The sector is up 7.7% this year.
Major stock indexes in Europe also closed higher.
Germany's DAX rose 0.7%, while the CAC-40 in France edged up 0.3%. Britain's FTSE 100 index was up 0.2%.
In Asia, Japan's Nikkei 225 index dropped 3.4% as a rising yen and quake-related production halts added to investor worries.
Hong Kong's Hang Seng index lost 0.7%. South Korea's Kospi slid 0.3%, while Australia's S&P/ASX 200 dipped 0.4%.