* Nearly a quarter of U.S. refining capacity out
* Benchmark U.S. gasoline prices up more than 26 pct on the week
* 'Worst thing in U.S. in decades' for energy mkt -source
* Roughly 13.5 pct of U.S. Gulf oil output shut in - BSEE
* Europe, Asia traders rush to reroute cargoes to Americas (Adds oil closures and SPR releases, comments, updates prices)
HOUSTON/NEW YORK, Aug 31 (Reuters) - Tropical Storm Harvey's effect on the energy industry spread worldwide as flooded U.S. refiners and closed fuel pipelines threatened to squeeze national supply, roiling global fuel markets and rerouting millions of barrels of fuel to the Americas to avert shortages.
The storm, which lashed Louisiana with rain on Thursday, has pummeled the U.S. Gulf Coast, immersing Houston, Texas, and surrounding areas in floodwater and forcing the closure of about a quarter of U.S. refining capacity.
Benchmark U.S. gasoline prices were more than 26 percent higher on the week, and the premium of front-month contract to the second month <RbC1-Rbc2> hit a nearly five-year high.
The Colonial Pipeline, the biggest U.S. fuel system, said it would shut part of its main lines to the Northeast after outages at pumping points and lack of supply from refiners.
That artery can carry 3 million barrels of gasoline and other products daily.
At least two East Coast refineries have run out of gasoline for immediate delivery as they scrambled to fill barges for markets normally supplied by the Gulf Coast, two refinery sources said.
Others were seen running at higher rates to boost profitability by filling shortages.
"This is going to be the worst thing the U.S. has seen in decades from an energy standpoint," said an East Coast market source, who declined to be named as he was not authorized to speak to the press.
On Thursday, the U.S. Energy Department said it would release two batches of oil from the Strategic Petroleum Reserve, totaling 1 million barrels, to supply the refineries that are still running in an effort to stem fuel shortages.
The first emergency release from the reserve since 2012 will be delivered to the Phillips 66 refinery in Lake Charles, Louisiana, according to a department statement.
The U.S. Department of the Interior's Bureau of Safety and Environmental Enforcement said that about 13.5 percent of oil production in the Gulf of Mexico was shut in on Thursday due to the storm.
Concerns over fuel shortages ahead of the U.S. Labor Day extended weekend were also mounting.
"Everything is fine until you get a surge in demand," said Alan Gelder, vice president of refining and oil at Wood Mackenzie, adding that "the fear of shortages ... can actually create shortages."
U.S. gasoline futures rose as high as $2.1705 per gallon for the first time since 2015, while Energy Secretary Rick Perry warned that pump prices would rise.
Average U.S. retail fuel prices have surged by more than a dime per gallon from a week ago, the American Automobile Association (AAA) said early on Thursday, reaching $2.449 per gallon nationwide.
The Gulf makes up nearly half of total refining capacity in the United States, the world's largest net exporter of refined petroleum products, and the storm is expected to affect global flows. (Graphic: http://tmsnrt.rs/2xzsKWz)
About 4.4 million barrels of U.S. refining capacity have been shut by Harvey, including the country's largest refiner, Motiva Port Arthur, which can process more than 600,000 barrels a day. The total shut-in is about 24 percent of U.S. refining capacity, almost equal to Japan's daily consumption.
The closures rattled global fuel markets, and European and Asian traders diverted millions of barrels of gasoline and diesel to the Americas to help fill the gap. But supplies from distant markets may not arrive soon enough to avert a crunch.
"An increased level of uncertainty is introduced surrounding the timeliness of delivery, given the logistics of travel time and securing tankers," said Michael Tran, director of global energy strategy at RBC Capital Markets.
The Asian refining margin on Thursday hit $10.41 a barrel, the highest since January 2016 <DUB-SIN-REF>. Gasoline prices in the region <GL92-SIN-CRK> were $16.34 a barrel, also the highest since January 2016. In Europe, benchmark gasoline margins jumped to a two-year high of nearly $20 per barrel.
U.S. disruptions have hit wholesalers. The premium for Chicago-area gasoline above benchmark futures is at its highest since June 2016, while the Gulf Coast price is at its widest above futures since August 2012.
Suppliers in Chicago were trying to secure supplies after the Explorer Pipeline, which typically carries about 350,000 barrels a day (bpd) to the region, shut down.
"It's not a significant problem at the present time, but it could turn into one," said William Fleischli, executive vice president of the Illinois Petroleum Marketers Association, which represents 400 fuel distributors. Fleischli said much depended on how long the shutdowns last.
In Georgia and North Carolina, fuel prices are up about 17 cents and average prices in South Carolina have risen nearly 20 cents per gallon from a week ago.
Energy analysts said they anticipated potential long-term effects from the historic storm. Goldman Sachs analysts wrote on Wednesday that they expected about a tenth of what is now offline to stay shut for several months.
(Reporting by Erwin Seba and Devika Krishna Kumar; additional reporting by Catherine Ngai, Julia Simon, Jarrett Renshaw, Henning Gloystein, Chris Prentice, Karolin Schaps, Ron Bousso, Libby George and Seng Li Peng; Writing by David Gaffen and Libby George; Editing by Bernadette Baum, Toni Reinhold)