* Nearly a quarter of U.S. refining capacity out
* Benchmark U.S. gasoline prices surge in overnight trading
* 'Worst thing in U.S. in decades from energy standpoint' -source
* Europe, Asia traders rush to reroute cargoes to Americas (Updates throughout with latest retail gasoline prices, market comment)
HOUSTON/NEW YORK, Aug 31 (Reuters) - Tropical Storm Harvey's effect on the energy industry has spread beyond flooding U.S. refiners as fuel pipelines also shut, threatening a supply squeeze across the nation and stirring up world markets as U.S. retail fuel prices rose further.
The storm, which lashed Louisiana with rain on Thursday, has pummeled the U.S. Gulf Coast, inundating Houston and the surrounding area under several feet of rain and forcing the closure of nearly a quarter of U.S. refining capacity.
Benchmark U.S. gasoline prices and margins <RBc1-Clc1> surged anew in overnight trading Thursday. The jump came after the Colonial Pipeline, the biggest U.S. fuel system, said it would shut its main lines to the Northeast by Thursday, hit by outages at pumping points and lack of supplies from refiners.
That artery can carry 3 million barrels of gasoline and other products daily.
At least two East Coast refineries have already 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 did not want to be identified because he was not authorized to speak to the press.
Concerns over fuel shortages ahead of the U.S. Labor Day weekend were mounting, said analysts at JBC Energy.
U.S. gasoline futures topped $2 per gallon for the first time since 2015, with benchmark prices now up more than 20 percent since the Aug. 23 close, just before the storm's beginning.
Average U.S. retail fuel prices have surged by more than a dime per gallon from a week ago, the AAA said early on Thursday.
The Gulf makes up nearly half of total refining capacity in the United States - the world's largest net exporter of refined petroleum products - sending the disaster's effects rippling through global flows. (Graphic: http://tmsnrt.rs/2xzsKWz)
About 4.4 million barrels of U.S. refining capacity have been shut by Harvey, including the nation'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.
Traders in Europe were rushing to reroute cargoes to the United States and Latin America to fill the gap left by refining and shipping closures, but supplies may not arrive fast enough to avert a crunch.
"Sourcing additional barrels from Europe is a potential solution, but 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.
Attracted by a surge in profits, refiners in Asia have also been trying to fix fuel cargoes to the United States, despite the huge distance across the Pacific.
Gasoline refinery profits in Singapore <GL92-SIN-CRK>, a benchmark in Asia, jumped to more than $15.60 per barrel, their highest level since early 2016.
The 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.
Average retail gasoline prices have risen to $2.449 per gallon nationwide, up 4.5 cents a gallon from a day earlier and 10.1 cents from a week ago, AAA data showed. 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.
Though flood waters had yet to recede, energy analysts said they anticipated potential long-term effects from the historic storm. Goldman Sachs analysts wrote 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 and Karolin Schaps; Writing by David Gaffen; Editing by Clarence Fernandez, Greg Mahlich)