The world’s top oil producers pulled off a historic deal to cut global petroleum output by nearly a 10th, putting an end to the devastating price war between Saudi Arabia and Russia.

After a week-long marathon of bilateral calls and four days of video conferences with government ministers from around the world - including the OPEC+ alliance and the Group of 20 nations - an agreement finally emerged to tackle the impact of the global pandemic on demand.

The talks almost fell apart because of resistance from Mexico, but came back from the brink after a weekend of urgent diplomacy, including the personal intervention of President Donald Trump, who helped broker the solution.

“Unprecedented measures for unprecedented times,”said Ed Morse, a veteran oil watcher who is head of commodities research at Citigroup. “Unprecedented in historical discussions of production cuts, the US played a critical role in brokering between Saudi Arabia and Russia for the new OPEC+ accord.”

OPEC+ will cut 9.7 million barrels a day - just below the initial proposal of 10 million. The US, Brazil and Canada will contribute another 3.7 million barrels on paper as their production declines. OPEC officials were still waiting to hear more from Group of 20 members - though it’s not clear if those numbers will represent real cuts or just production idled because of market forces.

“We have demonstrated that OPEC+ is up and alive,” Saudi energy minister Prince Abdulaziz bin Salman told Bloomberg News in an interview minutes after the deal was done. “I’m more than happy with the deal.”

The deal caps a tumultuous month when Brent crude, the global benchmark, plunged to its lowest in nearly two decades, falling toward $20 a barrel. Earlier this year, it traded above $70 a barrel. OPEC+ ministers had to race onto a video conference call on Easter Sunday, less than four hours before the oil market reopened, to close the deal.

With the virus paralysing air and ground travel, demand for gasoline, jet-fuel and diesel is collapsing. That threatened the future of the US shale industry, the stability of oil-dependent states and squeezed the flow of petrodollars through an ailing global economy.

Mexico won a diplomatic victory as it will only cut 100,000 barrels - less than its pro-rated share, having blocked the deal since the plan was first revealed on Thursday.

But the biggest winner appears to be Trump, who refused to actively cut American oil production and personally brokered the deal over phone calls with Mexican President Andres Manuel Lopez Obrador, Russian President Vladimir Putin and King Salman of Saudi Arabia.

“Perhaps what’s most remarkable about Saudi Arabia and Russia delivering one of the largest supply cuts ever is that the person who brought them back together and pressured hardest to cut was historically OPEC’s harshest critic, President Trump,” said Jason Bordoff, a former White House official during the Obama administration and now at Columbia University.

Trump became the first American president to push for higher oil prices in more than 30 years, reversing his personal opposition to the cartel.

“I hated OPEC. You want to know the truth? I hated it. Because it was a fix,” Trump told reporters at the White House last week. “But somewhere along the line that broke down and went the opposite way.”

The production restraints are set to last for about two years, though not at the same level as the initial two months. Copying the model adopted by central banks to taper off their bond buying, OPEC will also reduce the size of the cuts over time. After June, the 10 million barrel cut will be tapered to 7.6 million a day until the end of the year, and then to 5.6 million through 2021 until April 2022.

The production deal doesn’t take effect until May 1st, leaving OPEC+ countries, which have significantly increased production over the last month, able to continue flooding the market for nearly another three weeks.

Under the deal, Saudi Arabia will cut its production just a fraction under 8.5 million barrels a day - its lowest level since 2011. The OPEC+ deal measures the Saudi cut from a baseline of 11 million barrels a day, the same as Russia. But in reality the kingdom’s production will decline from a much higher level. In April, Saudi Arabia boosted output to a record 12.3 million barrels a day as part of its war with Russia for market share.

“We want to regain the stability of the oil market,” Prince Abdulaziz said.

The question now for the oil market is whether the cuts will be enough to throw a floor under prices as demand for energy craters. After the outline of the deal was announced last Thursday, oil prices in New York fell more than 9 per cent as traders thought the cuts weren’t large enough.

With countries around the world extending their lockdowns, the death toll mounting in New York, and unemployment exploding in America, the oil market is now far more worried about consumption than supply. OPEC itself acknowledged the challenge, with its chief warning ministers demand fundamentals were “horrifying.” In an internal presentation seen by Bloomberg News, OPEC told ministers it expected global oil demand to plunge 20 million barrels a day in April. - Bloomberg