* Harvey weakens to tropical storm, threatens widespread floods
* Hit Texas as Category 4 hurricane late Friday
* Buildings damaged, towns flooded on coast
* Utilities report 240,000 customers without power (Updates with tropical storm strength, latest oil output shut in)
ROCKPORT, Texas, Aug 26 (Reuters) - The most powerful storm to hit Texas in more than 50 years dumped torrential rain as it moved inland on Saturday, threatening widespread floods across the U.S. state and possibly in the city of Houston.
Tropical Storm Harvey is expected to lash Texas for days, bringing as much as 40 inches (102 cm) of rain after battering the coast when it came ashore on Friday. The storm has also triggered tornadoes and flash floods. Texas utility companies said nearly a quarter of a million customers were without power.
Harvey was the strongest storm to hit the state, the center of the U.S. oil and gas industry, since 1961. It came ashore as a hurricane with winds of 130 miles per hour (209 km per hour).
That made Harvey a Category 4 hurricane on the Saffir-Simpson scale, the second-highest category and the most powerful storm in over a decade to come ashore anywhere in the mainland United States.
There were no reported fatalities, Texas Governor Greg Abbott said on Saturday. Abbott said he will activate 1,800 members of the military to help with the cleanup while 1,000 people conduct search-and-rescue operations.
The seaside town of Rockport, 30 miles (48 km) north of the city of Corpus Christi, took a direct hit.
Harvey destroyed many homes and damaged many commercial buildings. The wind ripped off roofs and smashed windows.
The streets were flooded and strewn with power lines and debris on Saturday. At a recreational vehicle sales lot, a dozen vehicles were flipped over and one had been blown into the middle of the street.
"It was terrible," resident Joel Valdez, 57, told Reuters. The storm ripped part of the roof from his trailer home at around 4 a.m., he said. "I could feel the whole house move."
Valdez said he stayed through the storm to look after his animals.
"I have these miniature donkeys and I don't know where they are," he said, as he sat in a Jeep with windows smashed by the storm.
Resident Frank Cook, 56, also stayed through the storm.
"If you have something left of your house, you're lucky," he said, surveying the damage from his vehicle.
Before the storm hit, Rockport's mayor told anyone staying behind to write their names on their arms for identification in case of death or injury.
A high school, hotel, senior housing complex and other buildings suffered structural damage, according to emergency officials and local media. Some were being used as shelters.
The coastal city of Port Lavaca, farther north on the coast, had no power and some streets were flooded.
"There is so much tree damage and debris that the cost of cleanup will be enormous," Mayor Jack Whitlow told Reuters, after touring the city earlier Saturday.
The streets of Corpus Christi, which has around 320,000 residents, were deserted on Saturday, with billboards twisted and strong winds still blowing.
City authorities asked residents to reduce use of toilets and faucets because power outages left waste water plants unable to treat sewage.
A drill ship broke free of its mooring overnight and rammed into some tugs in the port of Corpus Christi, port executive Sean Strawbridge said. The crews on the tugs were safe, he added.
The city was under voluntary evacuation ahead of the storm.
HEADING INLAND, STORM WEAKENS
Harvey weakened to tropical storm from hurricane strength on Saturday, the U.S. National Hurricane Center said. The center of the storm was about 170 miles (241 km) west-southwest of Houston, moving at about 2 mph (4 kph), the center said in a morning update.
Houston is the fourth most populous city in the United States and home to a third of the 6 million people that could be impacted by Harvey.
Residents of the city received automatic cell phone warnings of flash floods early on Saturday. Authorities warned of the potentially life-threatening impact of close to 20 inches (60 cm) of rain falling on the city over several days. The storm's outer bands had already dumped six inches of rainfall on parts of the city by early Saturday afternoon.
The latest forecast storm track has Harvey looping back toward the Gulf of Mexico coast before turning north again on Tuesday. (http://tmsnrt.rs/2g9jZ0W)
"This rain will lead to a prolonged, dangerous, and potentially catastrophic flooding event well into next week," the National Weather Service said. Harvey has triggered flash floods, the NWS said.
The size and strength of Harvey dredged up memories of Katrina, the 2005 hurricane that made a direct hit on New Orleans as a Category 3 storm, causing levees and flood walls to fail in dozens of places. About 1,800 died in the disaster made worse by a slow government emergency response.
U.S. President Donald Trump, facing the first big natural disaster of his term, said on Twitter he signed a disaster proclamation that "unleashes the full force of government help" shortly before Harvey made landfall.
"You are doing a great job - the world is watching," Trump said on Saturday in a tweet referring to the Federal Emergency Management Agency (FEMA), which coordinates the response to major disasters.
GASOLINE PRICES SPIKE
Utilities American Electric Power Company Inc and CenterPoint Energy Inc reported a combined total of around 240,000 customers without power.
Several refiners shut down plants ahead of the storm, disrupting supplies and pushing prices higher. Many fuel stations ran out of gasoline before the storm hit, and the U.S. Environmental Protection Agency loosened gasoline specifications late on Friday to reduce shortages.
The American Automobiles Association said pump prices rose 4 cents in four days in Texas to reach $2.17 a gallon on Friday.
Disruptions to fuel supply drove benchmark gasoline futures to their highest price in four months.
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 is produced offshore in the Gulf of Mexico.
Just under 25 percent of Gulf output, or 429,000 barrels per day (bpd) had been shut in by the storm, the U.S. Bureau of Safety and Environmental Enforcement said on Saturday.
(Additional reporting by Jessica Resnick-Ault, Jarrett Renshaw, Taylor Harris, Devika Krishna Kumar and Sophia Kunthara in New York; Liz Hampton, Ernest Scheyder and Gary McWilliams in Houston; Writing by Simon Webb; Editing by Matthew Lewis and Lisa Shumaker)