Oil prices settled up nearly 6 percent on Wednesday after OPEC sources said the group has struck a deal to limit crude output at its policy meeting in November, its first agreement to cut production since the market crashed two years ago on oversupply.
The Organization of the Petroleum Exporting Countries reached agreement to limit its production by nearly a million barrels per day to 32.5 million bpd in talks held on the sidelines of the Sept. 26-28 International Energy Forum in Algiers, the sources told Reuters.
OPEC will agree to concrete levels of production for country at its Nov. 30 meeting in Vienna, the sources said.
After reaching its group target, it will seek support from non-member oil producers to further ease the global glut, they added.
settled up $2.72, or 5.9 percent, at $48.69 a barrel, hitting a more than two-week high of $48.96. U.S. West Texas Intermediate (WTI) crude settled up $2.38, or 5.3 percent, to $47.05 a barrel.
The oil rally spilled over into the stock market, with Wall Street's index of energy shares rising 4 percent on track to its best day since January.
"This is a historic deal. This is the first time OPEC and non-OPEC will agree together in over a decade. This should put a floor on oil and should see oil move back toward the $60s," Phil Flynn, analyst at Chicago-based brokerage Price Futures Group.
"The cartel proved that it still matters even in the age of shale! This is the end of the 'production war' - OPEC claims victory."
Other analysts saw a selloff down the road, citing OPEC's general lack of adherence to quotas.
"We don't know yet who's going to produce what. I want to hear from the mouth of the Iranian oil minister that he's not going to go back to pre-sanction levels. For the Saudis, it just goes against the conventional wisdom of what they've been saying," said Jeff Quigley, director of energy markets at Houston-based Stratas Advisors.
Oil prices have more than halved from highs above $100 a barrel in mid-2014 as surging production from U.S. shale oil combined with other global oversupplies and OPEC output.
As oil traders looked to OPEC to cut output, key members such as Saudi Arabia and Iran became more protective of individual market share. The deal in Algiers follows failed talks in Qatar in April for a production freeze.
Oil prices gyrated earlier in the day after U.S. government data showed a surprise drop in domestic crude stockpiles for a fourth week in a row. The drawdown was offset by a 2 million barrel build in gasoline stockpiles, compared with expectations in a Reuters poll for a gain of 178,000 barrels.
Jeff Quigley, director of energy markets at Stratas Advisors in Houston, said it was "too preliminary" to get excited over the OPEC deal.
"The devil's in the details here," Quigley said. "And for them to say it's going to start in November is very suspect to me. We don't know yet who's going to produce what. I want to hear from the mouth of the Iranian oil minister that he's not going to go back to pre-sanction levels."
Saudi Energy Minister Khalid al-Falih said on Tuesday Iran, Nigeria and Libya would be allowed to produce "at maximum levels that make sense" as part of any output limits which could be set as early as the next OPEC meeting in November.
Before the news of Wednesday's deal, Iranian Oil Minister Bijan Zanganeh said the Islamic Republic would agree to curb production "at close to 4 million barrels per day". Iran's output has stagnated at 3.6 million bpd since the lifting of Western sanctions.
Michael Cohen, head of energy commodities research at Barclays in New York, was similarly pessimistic.
"Our view is that it is likely that what is going to happen is nothing more than the status quo, in which the Saudis usually reduce their output post-summertime," Cohen said. "And this is a good way to put a good face on what is likely happening already."
— CNBC's Tom DiChristopher contributed to this report.