Endeavour and its crew of six departed the International Space Station late Sunday and headed home to wrap up NASA’s next-to-last shuttle flight.

The space shuttle undocked, for the very last time, close to midnight as the two spacecraft soared more than 322 kilometres above Bolivia.

“Fair winds and following seas, guys,” space station resident Ronald Garan, Jr. called out as he rang the ship’s bell.

“Appreciate all the help,” replied shuttle commander Mark Kelly.

Garan: “It was a pleasure serving with you boys.”

Endeavour is due back on Earth early Wednesday. It will be retired to a California museum after this 16-day journey, its last. Before leaving the neighbourhood of the space station, Endeavour took off on a photo-taking victory lap around the station early Monday. Kelly and his crew also planned a test of a navigation system intended for future spacecraft.

Kelly got a special musical send-off late Sunday night from his wife, Rep. Gabrielle Giffords. She’s recuperating in Houston from a gunshot wound to the head.

The wakeup call was a song by a Tucson, Ariz., band. Kelly said the song, “Slowness” by Calexico, is about two people reaching across a distance, and references places in Tucson, the Congresswoman’s hometown.

“I know she really, really wants to get back there,” he radioed. “It’s an appropriate song because that’s coming soon.”

The two space crews said their goodbyes earlier in the day, right before the hatches closed between them.

Kelly was the last to leave the space station, lingering for a few seconds with the three space station residents.

“We’re looking forward to getting home,” Kelly said, “and we’re going to leave these guys to some peace and quiet and not disturb their space station any more.”

The station’s skipper, Russian Andrey Borisenko, wished the six shuttle astronauts a “soft landing.”

Endeavour will return to Florida in the pre-dawn hours of Wednesday, never to fly in space again.

On its final journey, Endeavour delivered a $2 billion cosmic ray detector that will remain on the space station for the next decade.

The Alpha Magnetic Spectrometer already is collecting 25 million to 40 million cosmic particles a day worthy of analysis. It’s searching for antimatter and dark matter, and scientists hope the findings will shed light on the origin of the universe.

Kelly and his crew also provided the space station with a platform full of spare parts and an extension boom for future repair work. The boom, installed Friday on the fourth spacewalk of the mission, marked the completion of the U.S. portion of the space station.

The astronauts also worked on some of the critical life-support systems inside, in an effort to leave the orbiting outpost in the best possible shape for the shuttle-less years ahead.

Astronauts Mike Fincke and Gregory Chamitoff, who spent months living on the space station in years past, pretended they didn’t want to leave Sunday morning. They were dragged into the shuttle by their crewmates. Garan joined in on the joke, waving goodbye as if he were heading out aboard Endeavour as well. He’s just two months into his five-month station stay.

All told, the hatches between the two spacecraft were open 11 days.

Only one more shuttle flight remains for NASA.

Atlantis will blast off July 8 with a load of space station supplies to close out the 30-year shuttle program.

RELATED NEWS

After victory lap, Endeavour rolls to retirement September 22, 2012