The crew of the Atlantis bade a bittersweet farewell to astronauts on the International Space Station, wrapping up the final visit by a space shuttle to the orbiting outpost.
As the shuttle age draws to a close after 37 dramatic rendezvous, their crews held a moving ceremony, exchanging embraces and kisses before shutting the hatches separating them for a final time at 1428 GMT (0228 NZT).
Astronauts then placed an American flag seal over the passageway separating the shuttle and the space station, in a poignant gesture to symbolize the end of one era of US spaceflight and the dawn of a new one.
"When this flag returns again someday to Earth by astronauts that came up on an American spacecraft, its journey will not end there," said shuttle commander Chris Ferguson.
"Its journey will continue, it will leave low-Earth orbit once again, perhaps to a lunar destination - perhaps to Mars. It is our honor to have brought this flag here," he said.
"We're closing a chapter in the history of our nation," added astronaut Ronald Garan, a flight engineer stationed on the ISS.
"In the future when another spacecraft docks to that hatch... we are going to be opening a new era and raising the flag on a new era of exploration," Garan said, as Atlantis wrapped up its near eight-day visit.
Atlantis lifted off July 8 on the final flight of the shuttle program, STS-135, with a four-member crew, lugging the Raffaello multipurpose logistics module containing supplies and spare parts for the space station.
The Atlantis crew was to spend the remainder of the day preparing for Tuesday's undocking.
The shuttle was to fly home Thursday ahead of its retirement, which marks the end of the 30-year US space shuttle program.
The astronauts on the Atlantis - mission Commander Chris Ferguson, Pilot Doug Hurley, and Mission Specialists Sandy Magnus and Rex Walheim - are wrapping up a 13-day mission delivering supplies to help sustain the space station in the post-shuttle era.
Astronauts bound for the ISS now have to hitch a ride on the Russian Soyuz rocket, at more than $50 million per seat, until a new US space craft - a commercial launcher and capsule built by a private corporation in partnership with Nasa - is ready to fly sometime around 2015.
Nasa will rely on Russia to let them rent one of two available seats on the Soyuz, with a third seat on the space vehicle already taken up by the pilot.
The end of the shuttle program means that chances for astronauts to do the one thing they are trained for - fly into space - will become much rarer.
"Of course it's hard, because we dedicate our lives to fly in space. We are astronauts and it's what we do for a living," astronaut Steve Robinson, a veteran of four shuttle missions, told AFP earlier this month.
Nasa said Monday that a welcome home ceremony is planned for Friday in Houston, Texas, heralding the end of the shuttle era and to celebrate its many accomplishments.
Over the course of the three-decade-long program, five Nasa space crafts - Atlantis, Challenger, Columbia, Discovery and Endeavour - have comprised a fleet designed as the world's first reusable space vehicles.
Only three have survived after the shuttles Columbia and Challenger were destroyed in accidents that also killed their crews.
At a time of US budget austerity, President Barack Obama has opted to end the program at a huge savings. Each of the 135 missions over the years has cost about $450 million.
Obama also canceled Constellation, a project that aimed to put American astronauts back on the moon by 2020 at a cost of $97 billion.
Nasa administrator Charles Bolden recently told the House of Representatives Science, Space and Technology committee that there would be opportunities in commercial space flight in the near future.
"My hope is that we will have more than one American commercial-made capability to take humans to space by the 2015/16 time frame," Bolden said.
"We are not abandoning the human space flight. We have a big job to do of operating the ISS for the next nine years at least."