* About 23 pct of U.S. refining capacity shut
* Gasoline hits more than two-year high, margins rise
* EIA crude inventories show big drop pre-Harvey (New throughout, updates prices and market activity; new byline, changes dateline, previous LONDON)
NEW YORK, Aug 30 (Reuters) - Gasoline futures surged on Wednesday to another two-year high and crude oil fell, as flooding and damage from Tropical Storm Harvey shut nearly a quarter of U.S. refinery capacity, curbing demand for crude while raising the risk of fuel shortages.
Refineries with output of 4.2 million barrels per day (bpd) were offline on Tuesday, representing nearly 23 percent of U.S. production, according to Reuters estimates and company reports. Restarting plants even under the best conditions can take a week or more.
"It will be a while before operations can return to normal and the U.S. refining industry is bracing itself for an extended shutdown," Stephen Brennock of oil broker PVM said.
U.S. gasoline futures were up 6.5 percent at $1.8993 a gallon, having hit $1.9140, highest since July 2015. Diesel futures advanced by 1.7 percent to $1.6945 a gallon, having touched their highest since January at $1.7161.
Brent oil, the international crude benchmark, was down 48 cents at $51.52 a barrel at 10:54 a.m. EDT (1454 GMT). U.S. crude fell 39 cents to $46.05.
The spread between Brent and U.S. crude hit its widest in more than two years, and was lately at $5.39 a barrel.
"Certainly the spread widening out between WTI/Brent is Harvey-driven. You've pretty much sapped a major chunk of Gulf Coast refining demand," said Anthony Scott, managing director of analytics at BTU Analytics in Denver.
Gains intensified for refined products after sources on Wednesday said Total's Port Arthur, Texas, refinery had been shut by a power outage resulting from the storm.
Gasoline margins <RBc1-Clc1> jumped, as the gasoline crack spread jumped 12.5 percent to $23.45 a barrel, highest on a seasonal basis since 2012.
"Crude is always easier to replace than products," said Olivier Jakob, analyst at Petromatrix. "If the refineries stay shut for more than a week or 10 days, it's going to be very problematic."
Harvey made landfall on Friday as the most powerful hurricane to hit Texas in more than 50 years, resulting in the death of at least 17 people.
In addition to shutting oil refineries, about 1.4 million bpd of U.S. crude production has been disrupted, equivalent to 15 percent of total output, Goldman Sachs said.
Effects of the damages and shutdowns are expected to ripple for weeks. Explorer shut two main lines carrying fuel to the Chicago market Tuesday, and the main Colonial Pipeline to the U.S. East Coast was running at reduced rates.
The market shrugged off weekly inventory figures from the U.S. Energy Department, which reflect stocks prior to the storm. Crude inventories fell by 5.4 million barrels in the latest week, far more than the decrease of 1.9 million barrels analysts had expected. Refining capacity utilization rose to 96.6 percent, highest since 2005, a figure that will fall sharply due to massive shutins on the Gulf.
(Additional reporting by Alex Lawler and Henning Gloystein; Editing by Dale Hudson and David Gregorio)