The US benchmark WTI climbed 7.7 percent to $24.52 a barrel in early Asian trade while Brent was up 5.0 percent at $33.08.
OPEC producers dominated by Saudi Arabia and allies led by Russia thrashed out a compromise deal via videoconference Sunday after Mexico had balked at an earlier agreement struck on Friday.
In the compromise reached Sunday they agreed to a cut of 9.7 million barrels per day from May, according to Mexican Energy Minister Rocio Nahle, down slightly from 10 million barrels a day envisioned earlier.
OPEC Secretary General Mohammad Barkindo called the cuts "historic".
"They are largest in volume and the longest in duration, as they are planned to last for two years," he said.
The agreement between the Vienna-based Organization of the Petroleum Exporting Countries and partners foresees deep output cuts in May and June followed by a gradual reduction in cuts until April 2022.
Barkindo added that the deal "paved the way for a global alliance with the participation of the G20".
Saudi Energy Minister Prince Abdulaziz bin Salman, who chaired the meeting together with his Russian and Algerian counterparts, also confirmed that the discussions "ended with consensus".
US President Donald Trump welcomed a "great deal for all", saying on Twitter it would "save hundreds of thousands of energy jobs in the United States".
He added he "would like to thank and congratulate" Russian President Vladimir Putin and Saudi Crown Prince and de facto leader Mohammed bin Salman, both of whom he had spoken to.
The Kremlin confirmed the joint phone call, adding that Putin and Trump agreed on the "great importance" of the deal.
"This is good," Canadian Natural Resources Minister Seamus O'Regan tweeted. "We welcome any news that brings stability to global oil markets." Initial reticence from Mexico to introduce output cuts had led to a standoff that cast doubt on efforts to bolster oil prices, pushed to near two-decade lows.
Oil prices have slumped since the beginning of the year due to the COVID-19 pandemic that has sapped demand as countries around the world have put their populations under lockdown.
Compounding the problem, key players Russia and Saudi Arabia had engaged in a price war, ramping up output in a bid to hold on to market share and undercut US shale producers.
Rystad Energy analyst Per Magnus Nysveen said Sunday's agreement provided "at least a temporary relief" as fuel consumption was expected to fall globally by 27 million barrels per day in April and 20 million barrels per day in May.
His colleague Bjornar Tonhaugen said that even though the deal made "the single largest output cut in history", prices were still expected to see "renewed downwards pressure".
Other analysts were also concerned that the cuts did not go far enough with storage tanks rapidly filling up.
"The hard work lies ahead given that the market is very sceptical that OPEC+ are actually going to be able to come up with their near 10 million barrels a day of production cuts," Andy Lipow, president of Lipow Oil Associates LLC in Houston, told Bloomberg News.
AxiCorp's Stephen Innes added that "there remain concerns the agreement could be a day late and a 'barrel short' to prevent a decline in prices in the coming weeks as storage capacity brims".
Top oil producers struggled to finalise production cuts during a virtual summit held by G20 energy ministers on Friday, despite Trump's mediation efforts to end the standoff with Mexico.
Russian Energy Minister Alexander Novak was quoted by Russian news agency TASS as saying he did not expect oil markets to recover before "end of the year, in the best case".
Harry Tchilinguirian of BNP Paribas said "a sustained recovery" in the oil price was not expected "until pent-up demand is released in Q3 on the lifting of confinement and social distancing measures related to COVID-19". (AFP) AMSAMS