* Hurricane forecast to hit Gulf coast late Friday or Saturday
* Residents fleeing most powerful storm on U.S. mainland since 2005
* Locals told to take cover from wind, floods
* Oil and gas operations already affected
* Schools closed, flights canceled (Adds details from evacuation, quote from National Weather Service)
CORPUS CHRISTI, Texas, Aug 25 (Reuters) - Hurricane Harvey intensified on Friday into potentially the most powerful hurricane to hit the U.S. mainland in more than a decade, as authorities warned locals to shelter from what could be life-threatening winds and floods.
Harvey was set to make landfall late on Friday or early on Saturday in the middle Texas coast, slamming into Corpus Christi first and potentially looping back over the Gulf of Mexico before hitting Houston, some models showed.
Some of the biggest U.S. crude refineries are in the storm's projected path. Oil and gas operations have already been disrupted and U.S. gasoline prices have spiked.
Residents and emergency vehicles were streaming out of Corpus Christie, heading inland to emergency shelters or ferrying patients to safety under roiling skies and bright orange flares from the city's refineries, all of which had halted production.
Gas stations and grocery stores all along the south Texas coast were packed as residents readied their cars and pantries for any shortages following the storm.
At a Mathis, Texas, station, about 36 miles (59 km) northwest of Corpus Christi, an impatient driver leaned on his horn. "Come on," the man shouted.
Harvey strengthened into a category 2 storm with winds of 110 mph (177 kph) as it moved northwest about 140 miles (225 km) off Corpus Christi, the U.S. National Hurricane Center said. It projected windspeeds to reach 120 mph just before landfall.
The NHC expects Harvey to move slowly and linger over Texas for days. Its latest tracking model shows the storm moving back along the Texas coast early next week after sitting west of Houston, giving the nation's fourth most populous city a double dose of rain and wind.
"Now is the time to urgently hide from the wind. Failure to adequately shelter may result in serious injury, loss of life, or immense human suffering," the National Weather Service said.
Up to 35 inches (97 cm) of rain are expected over parts of Texas, and sea levels may surge as high as 12 feet (3.7 meters). Louisiana could get 10 to 15 inches of rain. Flood warnings are in effect for Louisiana and northern Mexico.
"Life-threatening and devastating flooding expected near the coast due to heavy rainfall and storm surge," the NHC said.
The storm's approach triggered evacuations in south Texas communities and central coast residents were voluntarily leaving the area. Cities canceled classes on Friday and Monday at dozens of schools along the south Texas coast, home to 5.8 million people from Corpus Christi to Galveston.
David Ramirez left his home in Corpus Christi early on Friday to wait out the storm in San Antonio, Texas.
"With the level of storm surge they're talking about, there isn't a lot I could do to protect my house," he said in an interview while awaiting directions to an emergency shelter.
Harvey also forced the cancellation or delay of at least 40 flights in and out of major airports in Texas on Friday, according to Flightaware.com, which tracks airline traffic.
Louisiana and Texas declared states of disaster, authorizing the use of state resources to prepare. President Donald Trump has been briefed and is ready to provide resources if needed, the White House said on Thursday.
Harvey is forecast to come ashore as a Category 3 hurricane, the NHC said, the third most powerful on the Saffir-Simpson scale. That would make it the first major hurricane to hit the mainland United States since Hurricane Wilma struck Florida in 2005.
Houston, the nation's fourth most populous city, warned residents of flooding from close to 20 inches of rain over several days.
GASOLINE PRICES SPIKE
More than 45 percent of the country's refining capacity is along the U.S. Gulf Coast, and nearly a fifth of the nation's crude oil is produced offshore. Ports from Corpus Christi to Texas City, Texas, were closed to incoming vessels.
The U.S. government said 9.6 percent of crude output capacity was shut and 14.6 percent of natural gas production was halted.
Three refineries in Corpus Christi and one farther inland at Three Rivers were shutting down ahead of the storm.
Concern that Harvey could cause shortages in fuel supply drove benchmark gasoline prices to their highest in four months. Meanwhile, U.S. gasoline margins <RBc1-CLc1> were at strongest levels in 5 years for this time of year.
Prices for gasoline in spot physical markets on the Gulf Coast rose even more, hitting a near three-year high.
One other refinery reduced output and others were considering shutting.
The U.S. government has emergency stockpiles of crude available to plug disruptions, and has regularly used them to dampen the impact on energy supplies of previous storms.
The stockpiles in the Strategic Petroleum Reserve were last used in 2012, after Tropical Storm Isaac shut down 95 percent of oil output in the Gulf and hit Louisiana. The government has not yet said if it plans to use the reserve after Harvey.
Houston-based energy bank Tudor Pickering Holt & Co said in a note not to expect significant or lasting production impacts from Harvey. But it said it would impact some production and disrupt refinery runs, imports and exports, "which will show up in the weekly inventory numbers for the next few weeks."
Royal Dutch Shell Plc, Anadarko Petroleum Corp and Exxon Mobil Corp have evacuated staff from offshore oil and gas platforms in the storm's path.
The storm could also bring flooding to shale oil fields in southern Texas that produce more than one million barrels of oil a day.
EOG Resources Inc said it had curtailed drilling and shut some production in the Eagle Ford shale region. Noble Energy Inc and Statoil ASA also said they were evacuating some staff from production facilities.
Union Pacific Corp, the No. 1 U.S. railroad, said it was moving rail cars in yards prone to flooding to high elevations and will curtail trains operating through areas likely to be hit by excessive winds and rain that will impact operations.
Union Pacific said changes could include locations from Brownsville near the border with Mexico north to Beaumont, Texas.
(Reporting by Brendan O'Brien in Milwaukee and Brian Thevenot in Corpus Christi; Editing by Phil Berlowitz and Meredith Mazzilli)