(Adds change in curfew hours, estimated damages)
HOUSTON, Aug 29 (Reuters) - President Donald Trump visited Texas on Tuesday to survey damage from the first major natural disaster to test his leadership in a crisis, as record rainfall from Tropical Storm Harvey lashed Houston and tens of thousands of people fled deluged homes.
The storm turning slowly in the Gulf of Mexico has brought catastrophic flooding to Texas, killing at least 12 people and paralyzing Houston, America's fourth most populous city. Damage was expected to run well into the tens of billions of dollars, making it one of the costliest U.S. natural disasters.
City officials were preparing to temporarily house some 19,000 people, with thousands more expected to flee the area as the flooding entered its fourth day and authorities found themselves running out of space in cramped shelters.
The mayor of Houston announced an indefinite 12 a.m. to 5 a.m. curfew amid reports of looting, armed robberies and people impersonating police officers.
Nearly a third of Harris County was under water, an area 15 times the size of Manhattan, according to the Houston Chronicle newspaper.
Harvey has affected nearly a fifth of U.S. refining capacity, triggering worries about lack of gasoline and sending gasoline futures to a two-year high this week. Nearly 20 percent of refining capacity is offline in Texas and Louisiana, according to company reports and Reuters estimates.
Although Houston residents saw patchy sunlight for the first time in days late on Tuesday afternoon, forecasters warned that 6 to 12 inches (15 to 30 cm) of rain was on its way and would continue through Thursday, badly straining the dams and drainage systems that protect the low-lying U.S. energy hub.
Meanwhile water levels continued to rise. Harris County officials warned residents to evacuate as they released water from overflowing reservoirs to alleviate pressure on two dams, a move that would add to flooding along the Buffalo Bayou waterway that runs through the area.
Residents within 1.5 miles (2.4 km) of a chemical plant in Crosby were also ordered to evacuate due to the rising risk of an explosion and subsequent leak.
$50 BILLION IN DAMAGE
Trump, speaking in Corpus Christi near where Harvey first came ashore last week as the most powerful hurricane to strike Texas in more than 50 years, said he wanted the relief effort to stand as an example of how to respond to a storm.
"This was of epic proportion. Nobody's ever seen anything like this," Trump said of Tropical Storm Harvey as he met with state and federal officials for a briefing at a Corpus Christi fire station.
The president said he was pleased with the response so far, but it was too soon to take a victory lap.
"We won't say congratulations. We don't want to do that.... We'll congratulate each other when it's all finished," he said.
Harvey has drawn comparisons with Hurricane Katrina, which devastated New Orleans 12 years ago, killing 1,800 people and causing an estimated $108 billion in damage.
Former President George W. Bush was widely criticized for his administration's handling of the response to that disaster, taking a heavy toll on public support of his administration, and Trump clearly was aiming to avoid a similar reaction.
Damage from Harvey could cost Houston up to $50 billion in lost economic activity and property damage combined, Houston Chronicle reported, citing an estimate from the Greater Houston Partnership and Moodys Analytics.
4,000 RESCUED AT SEA
Among the 12 confirmed fatalities was a family of six and Houston Police Sergeant Steve Perez, a 34-year veteran of the force who drowned while attempting to drive to work on Sunday, Police Chief Art Acevedo told reporters.
Acevedo said in an emotional news conference that Perez' family had urged him not to leave the house because of the dangerous flooding but the 60-year-old policeman told them, "We have work to do."
U.S. Coast Guard air units and boats have rescued more than 4,000 people, Captain Kevin Oditt, commanding officer of U.S. Coast Guard Sector Houston-Galveston, said at an afternoon news conference. The Coast Guard has 25 helicopters and three airplanes conducting search and rescue operations, he said.
The water line is higher than the roofs of some houses, leaving them completely submerged, said Commander Jim Spitler, commanding officer of Coast Guard Air Station Houston. Spitler advised anyone stuck on their roofs after dark on Tuesday to shine a flashlight or a cell phone light into the night sky, to make it easier for air crews to spot them.
Large numbers of civilians also formed ad hoc rescue groups, many using boats to pluck neighbors from flooded homes.
The National Hurricane Center on Tuesday afternoon said a record 51.88 inches (131.78 cm) of rain has fallen in Texas due to Harvey, a record for any storm in the continental United States.
This breaks the previous record of 48 inches set during tropical storm Amelia in 1978 in Medina, Texas, the NHC said. Medina is west of San Antonio. The island of Kauai was hit with 52 inches of rain from tropical cyclone Hiki in 1950, before Hawaii became a U.S. state.
About 9,000 evacuees were staying at Houston's George R. Brown Convention Center and city officials on Tuesday opened the Toyota Center arena to house more storm refugees.
Other shelters were set up in Dallas, about 250 miles (402 km) to the north, for about 8,000 people, and Austin, 160 miles (258 km) west, to take in 7,000 people. The Red Cross said it had 34,000 cots in the region and enough food for that many people.
The slow-moving storm's center was in the Gulf of Mexico about 70 miles (150 km) southeast of downtown Houston by Tuesday evening and Harvey was expected to move inland again early Wednesday, according to the U.S. National Hurricane Center.
(Additional reporting by Gary McWilliams, Ernest Scheyder, Erwin Seba, Ruthy Munoz and Peter Henderson in Houston; Andy Sullivan in Rockport, Texas; Jon Herskovitz in Austin; Steve Holland in Corpus Christi, Texas; Bernie Woodall in Fort Lauderdale, Florida, David Gaffen in New York and Alex Dobuzinskis and Dan Whitcomb in Los Angeles; Writing by Scott Malone and Dan Whitcomb; Editing by Bill Trott and Lisa Shumaker)