CAPE CANAVERAL, Fla. (AP) -- Space shuttle Endeavour and its six astronauts returned to Earth on Wednesday, closing out the next-to-last mission in NASA's 30-year program with a safe middle-of-the-night landing.
Endeavour touched down on the runway a final time under the cover of darkness, just as Atlantis, the last shuttle bound for space, arrived at the launch pad for the grand finale in five weeks.
Commander Mark Kelly -- whose wife, Rep. Gabrielle Giffords, remained behind at her rehab center in Houston -- brought Endeavour to a stop before hundreds of onlookers that included the four Atlantis astronauts who will take flight in July.
"122 million miles flown during 25 challenging spaceflights," Mission Control told Kelly and his crewmates, who wrapped up U.S. construction at the International Space Station. "Your landing ends a vibrant legacy for this amazing vehicle that will long be remembered. Welcome home, Endeavour."
Kelly replied: "It's sad to see her land for the last time, but she really has a great legacy."
He thanked all those who worked on Endeavour over the years.
A considerably bigger crowd gathered a few hours earlier to see Atlantis make its way to the launch pad, the last such trek ever by a shuttle. Thousands of Kennedy Space Center workers and their families lined the route Tuesday night as Atlantis crept out of the mammoth Vehicle Assembly Building a little after sunset, bathed in xenon lights.
"The show pretty much tells itself," Atlantis' commander, Christopher Ferguson, said as he waved toward his ship. "We're going to look upon this final mission as a celebration of all that the space shuttle has accomplished over its 30-year life span."
Bright lights also illuminated the landing strip for Kelly and his crew, who made the 25th night landing out of a total of 134 shuttle flights.
The Endeavour astronauts -- all experienced spacemen -- departed the 220-mile-high outpost over the weekend, after adding the finishing touches. They installed a $2 billion cosmic ray detector, an extension beam and a platform full of spare parts, enough to keep the station operating in the shuttle-less decade ahead.
Their flight lasted 16 days and completed NASA's role in the space station construction effort that began 12 years ago.
The official tally for NASA's youngest shuttle after 25 flights, nearly half of them to the space station: 170 crew members, 299 days in space, 4,672 orbits of Earth, and 122.8 million miles.
Kelly's wife was shot in the head during a mass shooting in January, but made a remarkable recovery and was able to attend the launch May 16. She did not travel to Florida for the landing because of the inconvenient hour, her husband said. They will reunite in Houston on Thursday.
Their flight lasted 16 days and, with a series of four spacewalks, completed NASA's role in the space station construction effort that began more than 12 years ago.
Endeavour is the second shuttle to be retired. It ultimately will be at the California Science Center in Los Angeles.
Built to replace the destroyed Challenger, Endeavour first soared in 1992 on a satellite-rescue mission that saw a record-setting three spacewalkers grab the wayward craft. Other highlights for the baby of the fleet: the first repair mission to the Hubble Space Telescope in 1993, to fix its blurred vision, and NASA's first flight to assemble the space station in 1998.
Atlantis will remain at Kennedy Space Center as a tourist stop, following one last supply run to the space station. Liftoff is set for July 8.
Discovery, the fleet leader, returned from its final voyage in March. Its next stop is a Smithsonian Institution hangar outside Washington.
NASA is leaving the Earth-to-orbit business behind to focus on expeditions to asteroids and Mars. Private companies hope to pick up the slack for cargo and crew hauls to the space station. But it will be a while following Atlantis' upcoming flight -- at least three years, by one business' estimate -- before astronauts ride on American rockets again.
Until then, Americans will continue hitching rides aboard Russian Soyuz capsules at the cost of tens of millions of dollars a seat.
"We're in the process of transition now, and it's going to be awkward," said Atlantis astronaut Rex Walheim. "But we'll get to the other side and we'll have new vehicles.
"I really do have to say, though, it's going to be really hard to beat a vehicle that is so beautiful and majestic as that one is," he said as Atlantis rolled to the pad behind him. "I mean, how can you beat that? An airplane sitting on the side of a rocket. It's absolutely stunning."
(Copyright 2011 by The Associated Press. All Rights Reserved.)