* 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 (Recasts to focus on path of storm, adds quote from Texas governor, comment from evacuee, updates oil prices, refineries status)
CORPUS CHRISTI, Texas, Aug 25 (Reuters) - Businesses closed and lines of cars streamed out of coastal Texas as officials called for residents to evacuate ahead of Hurricane Harvey, expected to arrive about midnight as the most powerful storm to hit the U.S. mainland in more than a decade.
The hurricane is forecast to slam first near Corpus Christi, Texas, drop flooding rains along the central Texas coast and potentially loop back over the Gulf of Mexico before hitting Houston, some models showed.
"My urgent message to my fellow Texans is that if you live in a region where evacuation has been ordered, you need to heed that advice and get out of harm's way while you can," Texas Gov. Greg Abbott said in a televised address.
The storm has disrupted some of the region's oil production and refining operations, sending gasoline prices higher. Some 4 percent of U.S. refinery capacity and nearly 10 percent of offshore oil production was halted. Some inland shale oil producers ceased operations as a precaution against expected flooding.
Gas stations and grocery stores in the region were packed as residents readied their cars and pantries for any shortages following the storm.
At a Willis, Texas, station, about 50 miles (77 km) north of Houston, Corey Martinez, 40, was heading to Dallas from his Corpus Christi home.
"It has been pretty stressful. We're just trying to get ahead of the storm," he said. "We've never been through a hurricane before."
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 could reach 120 mph just before landfall.
The NHC's latest tracking model shows the storm sitting southwest of Houston for more than a day, 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 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. Two others reduced output as ports were closed.
Concern that Harvey could cause shortages in fuel supply drove benchmark gasoline prices to their highest in four months, before profit trading pulled back prices. Meanwhile, U.S. gasoline margins <RBc1-CLc1> hit their strongest levels in 5 years for this time of year earlier in the day.
Prices for gasoline in spot physical markets on the Gulf Coast rose to a near three-year high.
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 potential for flooding at shale oil fields in south Texas that produce more than one million barrels of oil a day led several producers to curb operations. EOG Resources Inc said 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 Meredith Mazzilli and Andrew Hay)