Oil surged the most in three months as global equities erased losses sparked by the U.K.’s secession vote and a weaker dollar bolstered the appeal of commodities.

Futures climbed 4.6 percent in New York. The dollar fell against most of its peers, while stocks rose on the prospect of stimulus in major economies. U.S. crude supplies probably slipped 3 million barrels last week, according to a Bloomberg survey before government data Wednesday. Royal Dutch Shell Plc said the Trans Niger pipeline in Nigeria, capable of shipping 180,000 barrels a day, was halted after the discovery of a leak.

“Equities are at new highs and the dollar’s lower; these are the primary drivers,” said Kyle Cooper, director of research at IAF Advisors and Ion Energy in Houston. “Crude and the dollar usually move in opposite directions, and the relationship is stronger than normal now.”

Oil retreated in recent weeks as a rally spurred by supply disruptions in Nigeria and Canada and falling U.S. output lost momentum. Prices remain up about 70 percent from a 12-year low in February, a recovery that has prompted American producers to return drilling rigs to service. The rate of decline in non-OPEC supply will slow next year, OPEC said in a report Tuesday.

West Texas Intermediate oil for August delivery rose $2.04 to $46.80 a barrel on the New York Mercantile Exchange. It’s the biggest one-day gain since April 8. Prices settled at $44.76 on Monday, the lowest since May 10. Total volume traded was 35 percent above the 100-day average at 2:59 p.m.

Equity Rally

Bren t advanced $2.22, or 4.8 percent, to $48.47 a barrel on the London-based ICE Futures Europe exchange. It’s also the biggest gain since April 8. The global benchmark closed at a 90-cent premium to WTI for September delivery.

“We tested the low end of the range of $45 to $50 yesterday. Prices dropped below $45 and the buying started again,” said Bill O’Grady, chief market strategist at Confluence Investment Management in St. Louis, which oversees $4.9 billion. 

The Dow Jones Industrial Average reached a record while the Standard & Poor’s 500 Index extended an all-time high. The S&P 500 Oil & Gas Exploration and Production Index was up 5.1 percent at 3:01 p.m., heading for biggest gain since April 12.

The Bloomberg Dollar Spot Index, a gauge of the greenback against 10 major peers, fell 0.2 percent. A weaker greenback increases investor demand for dollar-denominated raw materials.

Stockpile Declines

U.S. inventories are forecast to drop for an eighth week, according to a Bloomberg survey. That would be the longest run of declines in more than a year. Stockpiles slipped by 2.2 million barrels to 524.4 million barrels in the week ended July 1, according to Energy Information Administration data.

Attacks on oil facilities cut Nigeria’s production to about 1.4 million barrels a day in May, the lowest in 27 years, International Energy Agency data show. A lull in the unrest helped boost output to 1.9 million barrels a day as of July 8, said Emmanuel Kachikwu, minister of state for petroleum. Attacks on Chevron Corp. pipelines in the past week have put the recovery in doubt.

“The market tightened dramatically because of the disruptions in Canada and Nigeria, and the decline in output here,” said Chris Kettenmann, chief energy strategist at Macro Risk Advisors in New York. “I think the supply is coming back.”

OPEC forecast higher demand for its crude next year as the global surplus fades, while Saudi Arabia pumped near-record levels amid peak summer consumption. The 14 members of the Organization of Petroleum Exporting Countries, including new member Gabon, will need to pump about 33 million barrels a day next year, 142,000 a day more than June output, the group said.

Oil-market news:

The EIA boosted its U.S. crude production outlook for 2016 and 2017 and expects prices in New York to average $52.15 next year, up from an earlier forecast of $51.82. Nigeria’s Pengassan union said it was close to reaching an agreement with the government to end a four-day strike. The one-year price contango for Brent has almost doubled in the past month, a signal that demand from refiners could be weakening. Iran is exporting about 2 million barrels of its daily output of 3.8 million, said Mohsen Ghamsari, National Iranian Oil Co.’s director of international affairs.

Copyright 2018 Bloomberg. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.