After 24 hours of clogged highways, stranded drivers and short tempers, major routes around Houston returned almost to normal Friday afternoon, but not before the mammoth, snarled evacuation underscored what many emergency planners already knew: There is virtually no way to evacuate a large U.S. city quickly and smoothly.

State and local officials faced criticism Friday morning after a day and night of gridlocked traffic on all main routes as millions of residents in southeast Texas attempted to flee Hurricane Rita. Highways were littered with families whose vehicles had run out of gas after 15 or more hours on the road, in what was described as one of the largest peacetime evacuations in U.S. history.

With many service stations also out of fuel, local officials mobilized to deliver gasoline to those still stranded and pledged quick action to get everyone off the highways to safer territory before Rita's expected arrival Saturday. As they sought to complete the evacuation, officials were peppered with questions about whether the congestion could have been avoided.

Texas Gov. Rick Perry (R) described traffic during the worst of the evacuation as "excruciatingly slow," but state officials defended the exodus as an overall success. By late Friday, some parts of Houston appeared virtually empty and the roads were quiet.

"Certainly, there were some glitches in terms of traffic management," said Steve McCraw, Texas director of homeland security at a Friday afternoon briefing in Austin. "When you have 2.5 million people leaving a particular area with almost 400,000 evacuees from Louisiana living at some of those shelters and locations, you do have some unique challenges. However, we do consider it a success."

Dallas Mayor Laura Miller was initially more critical in a telephone interview Friday morning. "What they're doing so far just isn't working," she said. But she acknowledged that the scope of the evacuation may have been so great that there was no way to avoid problems. "If this has never been done before and they never envisioned having to do it, perhaps you can't fault anybody," she said.

What happened in Houston has implications for other major cities that face either the threat of sudden natural disaster or terrorist attack, a reminder of the limitations of attempting to move huge numbers of people quickly from an urban environment.

Time and geography are the enemies of evacuations, said Richard A. Falkenrath, former White House deputy homeland security adviser who is now with the Brookings Institution. Texas had plenty of time to move people ahead of the storm, but in the event of a terrorist attack -- a radioactive or toxic plume threatening a metropolitan area -- there would be little time to get people out of its path.

"That is the hardest of the hard cases, which is that you've got to get people out of the downwind plume in less than an hour," Falkenrath said. "No government in the United States is prepared to do that. It's just going to be pandemonium."

The experience in Texas showed the limits of preparation, just as the experience in New Orleans showed the opposite, experts said. In New Orleans, the failure to evacuate quickly led to widespread suffering and avoidable loss of life. In Texas, efforts to move well ahead of the storm revealed a different set of problems that emergency planners will be studying once it has passed.

Texas officials said the evacuation, however difficult, had resulted in moving between 2.5 million and 3.5 million people out of the direct path of the hurricane. "Obviously, it would have been foolhardy not to encourage people to leave," said Texas state Sen. Rodney Ellis. "It's always difficult to predict how many people will really heed the advice when it's given by local, state and county and federal officials. The good news is people did heed the advice."

Similarly, during Hurricane Floyd in 1999, more than 3 million residents -- 1 million more than anticipated -- emptied out of Florida, Georgia and the Carolinas only to run into massive traffic jams.

Officials in Texas and elsewhere blamed the clogged highways on several factors: the size, strength and uncertain landfall of Hurricane Rita at the time the evacuation orders were issued; and fresh images of the devastation along the Gulf Coast from Hurricane Katrina, which may have prompted many more people in Texas to leave their homes and get in their cars.

Others said the size and speed of the exodus simply overwhelmed the highway system. "In Texas, you've got 2.7 million people who evacuated," said Robert B. Stephan, assistant secretary for infrastructure protection at the Department of Homeland Security. "That just taxes every transportation asset. I don't care if you're the most brilliant leader in the world, there's no way to anticipate all the branches and sequels to that."

When the evacuation order was given, the storm's projected path showed Rita landing between Galveston and Corpus Christi along the south Texas coast. Later, the path shifted north and east, with the projected landfall closer to the Beaumont-Port Arthur area nearer the Louisiana border. That meant residents in a huge area were scrambling to safety, with many funneling through the Houston area.

Because the Houston region has had previous experience with storms and flooding, officials also believed it was essential to move early, even as those tracking the storm were trying to estimate its severity and location. Seeking to avoid a repeat of what happened in New Orleans, officials gave a high priority to evacuating hospitals as well as residents who could not get out themselves.

Almost by definition, even a successful evacuation while underway will produce images of transit routes at the limits of their capacity, emergency managers said. Only when travel has ceased can a fair measure of the evacuation be done.

The Rita evacuation occurred with unusual advance warning. Texas authorities had at least up to four days' notice of Rita's approach, issued voluntary evacuation orders about 72 hours ahead of time and mandatory orders for the most vulnerable areas beginning about 60 hours before expected landfall, perhaps motivated by Katrina's example to make the hard decision early.

"A traffic jam doesn't mean a failure of your evacuation," said Virginia homeland security adviser George W. Foresman, whose state evacuated parts of populous Hampton Roads for Hurricane Isabel in September 2003. "There has been sufficient time, based on all the study data, to know that the decisions were made in the right time frame."

To an extent, emergency managers said, the public, not the government, created Thursday's crisis. Evacuation studies are premised on three factors -- traffic volume estimates, flood models and polling-based behavioral studies that project what people in particular neighborhoods will do when told to leave.

In the face of a high-category hurricane, perhaps 70 to 90 percent of people in evacuation areas are expected to follow mandatory orders. But Katrina and Rita may have changed the standard for public behavior, requiring changes in hurricane plans.

Staff writers Blaine Harden in Houston and Steve Hendrix in Austin, and researcher Meg Smith in Washington contributed to this report.

Galveston residents Kris Kardias and Steve Berzanskis took shelter at the Alamo Elementary School after their evacuation bus broke down.

In Lake Charles, La., Christopher Thomas, 11, hangs on to his pet, Harley, as residents plead with him and his mother to forget the dog and leave.