Gasoline futures surged more than 13 per cent on Thursday, and crude oil settled nearly 3 per cent higher, as almost a quarter of US refining capacity remained offline and traders scrambled to reroute millions of barrels of fuel.

US gasoline futures have rallied more than 28 per cent from the previous week to a two year high above $2 a gallon, buoyed by fears of a fuel shortage days ahead of the US Labor Day weekend’s traditional surge in driving. Gasoline settled up 25.52 cents, or 13.54 per cent, at $2.1399.

Hurricane Harvey—which brought record flooding to the US oil heartland of Texas and killed at least 35 people—has paralyzed at least 4.4 million barrels per day (bpd) of refining capacity, according to company reports and Reuters estimates.

The US Department of the Interior’s Bureau of Safety and Environmental Enforcement said that roughly 13.5 per cent of oil production in the Gulf of Mexico was also shut in on Thursday.

The US government tapped its strategic oil reserves for the first time in five years on Thursday, releasing 1 million barrels of crude to a working refinery in Louisiana. Traders were also scrambling to redirect fuel to the United States.

At the US West Texas Intermediate (WTI), crude futures settled $1.27 higher at $47.23 per barrel, up 2.76 per cent. It remained on track to close August down almost 6 per cent, the steepest monthly loss since March.

International benchmark Brent crude settled $1.52 higher, or 2.99 per cent, at $52.38 a barrel. It had fallen by just over 2 per cent in the previous session.

“The market has turned in reverse pretty sharply,” said Gene McGillian, anager of market research at Tradition Energy. “You do have some signs of rebalancing, regardless of Harvey,” he said.

On Wednesday, oil prices fell despite a weekly drop in closely watched US commercial crude stocks of 5.39 million barrels. Crude inventories are 14.5 per cent below record levels hit in March.

OPEC output this month also fell 1,70,000 bpd from a 2017 high, a Reuters survey found, as renewed unrest cut supplies in Libya and other members stepped up compliance with a production-cutting deal.

Analysts called the status of US refineries a key to oil prices. “The disruptions in recent days may delay the ongoing global crude oil rebalancing process,” Bank of America Merrill Lynch said in a note.

Analysts at Goldman Sachs and Stifel said US outages would probably last several months but it was difficult to estimate the exact damage. Others said higher gasoline prices might prompt operational refineries to delay typical September seasonal maintenance.

“Refineries outside the affected area may delay maintenance to benefit from high processing margins,” said Commerzbank oil analyst Carsten Fritsch, adding, “Hence, the negative impact on crude oil demand and oil product supply might be less severe than feared.”

Shrinking crude stocks and expectations for rising growth in global demand meant analysts in a monthly Reuters poll raised their oil price forecasts for the first time in six months.