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.
Endeavour, the youngest of the shuttles, logged nearly 123 million miles over 25 spaceflights.
"Your landing ends a vibrant legacy for this amazing vehicle that will long be remembered. Welcome home, Endeavour," Mission Control told Kelly and his crewmates, who wrapped up U.S. construction at the International Space Station.
"It's sad to see her land for the last time," Kelly replied, "but she really has a great legacy."
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, 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. 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 Endeavour was 170 crew members, 299 days in space, 4,671 orbits of Earth and 122,883,151 miles.
Kelly was the last astronaut to exit Endeavour. "Had some nice weather, and it's nice to bring Endeavour back here to KSC," he said as climbed out.
Kelly's congresswoman wife was shot in the head during a mass shooting in January, but made a remarkable recovery and was able to attend the May 16 launch. Giffords did not travel to Florida for the landing because of the inconvenient hour, but his two teenage daughters were on hand, along with his twin brother, Scott, who is also an astronaut.
Giffords and Kelly 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. They were the last spacewalks to be conducted by a shuttle crew. One of the spacewalking astronauts, Mike Fincke, set a U.S. career record of 382 days in space.
Endeavour is the second shuttle to be retired. It ultimately will be put 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."