The shuttle is now scheduled to depart from the international space station on Sunday, and landing is set for Tuesday.
The astronauts had hurriedly completed a shortened spacewalk Saturday and were still cleaning up from it when the decision came down from mission managers. The two crews shook hands and said goodbye, then closed the hatches between their docked spacecraft.
NASA worried the hurricane might veer toward Houston, the home of Mission Control, forcing an emergency relocation of flight controllers to Cape Canaveral. The makeshift control center there would not be nearly as good or big as the Houston operation, and that's why managers wanted to bring Endeavour back to Earth early.
Hurricane Dean, a fierce Category 4 storm, was headed toward Mexico's Yucatan Peninsula and the Gulf of Mexico. It was uncertain whether the storm might strike the Texas coastline late in the week; that uncertainty made NASA's decision — so many days in advance — all the harder.
LeRoy Cain, who headed Saturday's mission management team meeting, acknowledged that the hurricane's predicted path was shifting southward and farther from Houston. But he said it would have been irresponsible for NASA not to cut the mission short, considering most everything had already been accomplished in orbit.
"I would defy just about anybody to tell me at this point that there's zero or even extremely low probability or possibility that the storm is going to come here," Cain said.
NASA is ready to rush a skeleton crew of flight controllers to Cape Canaveral, but only if the shuttle cannot land Tuesday for some reason and the hurricane is bearing down on Houston and threatening the city for several days, Cain said. "That's a fairly, I hope, unlikely scenario simply because all those things have to line up," he said.
In 26 years of space shuttle flight, NASA never has had to call up an emergency Mission Control, although it's been practiced.
During a spacewalk that was shortened to save time, Dave Williams and Clay Anderson could see the eye of the giant hurricane as the shuttle-station complex orbited 214 miles above the Caribbean, exclaiming "oh wow" and "holy smokes." "Hooo, man, yeah, can't miss that," one of them said.
Williams and Anderson tackled only the most important space station maintenance chores that had been planned for the fourth and final spacewalk of Endeavour's mission. Mission Control cut two hours from the spacewalkers' to-do list so the hatches between the linked spacecraft could be closed late Saturday afternoon.
The two men attached a stand to the station's exterior for a shuttle inspection boom. The stand won't be used until next year. They also retrieved two experiments from the outside of the station for return to Earth, and hooked up antenna equipment.
Three hours into the five-hour spacewalk, a fire alarm sounded inside the station, its shrill beeps loud enough to be heard over the radio loops. The station crew rushed to check, but could find no evidence of smoke and Mission Control quickly confirmed it was a false alarm. The same alarm acted up a few weeks ago.
The brief interruption did not affect the spacewalk.
The spacewalkers' gloves, meanwhile, held up just fine. The previous spacewalk was cut short after one astronaut ripped his glove. As a precaution, Williams and Anderson frequently checked their gloves and stayed clear of sharp edges.
"My gloves look like they just came off the showroom floor," Anderson said as the spacewalk ended.
NASA's hurricane deliberations followed a decision to forgo shuttle repairs.
Late Thursday, mission managers concluded that a deep gouge on Endeavour's belly posed no Columbia-like threat to the seven crew members during re-entry and also would not lead to lengthy postflight shuttle repairs. For a week, managers had considered sending two astronauts out with black protective paint and untested goo to patch the 3 1/2-inch-long, 2-inch-wide gouge that dug all the way through the thermal tiles.
The gouge was caused by debris that broke off a bracket on Endeavour's external fuel tank during liftoff Aug. 8. Engineers still do not know whether it was foam insulation, ice or a combination of both. In any case, NASA said it will not launch another shuttle until the longtime troublesome brackets are fixed.
Endeavour's crew includes teacher-astronaut Barbara Morgan, who was Christa McAuliffe's backup for Challenger's tragic 1986 flight.
The space station's commander, Russian cosmonaut Fyodor Yurchikhin, was sorry to see his shuttle guests leave early.
"Unfortunately, it's too quiet on station now," he told Mission Control, "and we are like alone."
• Click here to visit FOXNews.com's Space Center.