Gasoline and oil prices continued to diverge on Wednesday, as Tropical Storm Harvey dumped more rain along the Gulf Coast and forced the full shutdown of the nation's largest refinery.

After making landfall in Texas this weekend, Harvey moved east and came ashore again in Louisiana, threatening to disrupt more of the area's refining capacity and compounding fears of fuel shortages.

Continue Reading Below

On Wednesday, Motiva reported that it is shutting down its 603,000-barrel-a-day refinery in Port Arthur, Texas. The largest refinery in the U.S. is one of the latest to be affected by Harvey, which has taken around 20% of the country's refining capacity offline.

Exxon Mobil Corp.'s refinery in Beaumont, Texas, is also shutting down, after running at reduced rates since Monday, the company said. Exxon's Baytown facility, the nation's second-largest refinery, has been shut down since Sunday.

"This is as bad as it's ever been," said Kyle Cooper, a consultant at ION Energy Group in Houston. "I would say that to a large extent, the worst is being priced in" for energy markets.

Gasoline prices surged to a two-year high on Wednesday, as traders anticipated a shortage of supply following the storm. Futures for September delivery rose 5.7% to $1.8847 a gallon on the New York Mercantile Exchange, the seventh straight session of gains and the biggest one-day gain since Nov. 30. Diesel futures for September delivery increased 0.5% to $1.6738 a gallon.

"I think you're seeing a lot of protective behavior by suppliers all around the country," said Mark Anderle, director of supply and trading at TAC Energy. "That should drive up the wholesale and retail prices really across the country."

Meanwhile, U.S. crude futures for October delivery fell for the third day in a row, closing down 48 cents, or 1%, at $45.96 a barrel, a one-month low. Brent, the global benchmark, lost $1.14, or 2.2%, to $50.86 a barrel.

Refinery shutdowns across Texas will mean less demand for crude oil, a dismal sign for those betting that a global glut of crude has abated in recent months.

In data released Wednesday, the U.S. Energy Information Administration reported that crude stockpiles fell by 5.4 million barrels in the week ended Aug. 25, exceeding analyst expectations for a drop of 1.8 million barrels and marking the ninth-consecutive week of inventory declines.

However, the market shrugged off the report, since the time frame was unlikely to show any impact from the tropical storm. Harvey also looks poised to muddle EIA data for the next few weeks, overshadowing its importance as a gauge of supply-and-demand balance, traders and analysts said.

"Mostly what this report is good for is a 'before' snapshot," said Mr. Anderle. In the coming weeks, "the statistics are going to look drastically different than they did today."

Traders remained focused on dissecting how Harvey will affect refinery operations as it moves into Louisiana. Some Corpus Christi, Texas, refiners have announced plans to restart in the coming days, helping boost oil prices briefly during Wednesday's trading.

"There seems to be more optimism developing as to a light at the end of the tunnel," said Donald Morton, senior vice president at Herbert J. Sims & Co. "My personal opinion is that the light is a long ways away."

While many market participants are still trying to gauge the extent of the damage done to infrastructure in Houston, analysts said further rainfall could keep refining capacity offline longer than some expect.

"The continued increase in flooding creates high uncertainty on the amount of damage that U.S. refineries will incur, the pace at which the shutdown will reverse and the magnitude of capacity that will be impaired over the next few months," Goldman Sachs analysts wrote in a Wednesday note.