Space shuttle Endeavour undocked from the international space station on Saturday, bringing home three men who had lived on the orbiting outpost since summer.

Before leaving, astronaut Frank Culbertson gave the new space station residents candy canes and a small fabric Christmas tree decorated with gifts for every day until Dec. 25, intended as a holiday countdown.

"It's been a great ride, a great trip, and it's now time to say goodbye," said Culbertson, who served as the space station's skipper for four months.

The retired Navy captain saluted Russian Yuri Onufrienko, his successor, then floated out of the station and into the shuttle for his long-awaited ride home. Astronaut Daniel Bursch, a Navy officer left behind, rang the ship's bell and called out in naval fashion: "Expedition Three, departing."

Onufrienko, Bursch and astronaut Carl Walz make up Expedition Four, the fourth team to live on the space station. They will spend almost six months in orbit, returning to Earth in May.

"We feel like we've accomplished a lot. We feel our mission has been successful," Culbertson noted in a farewell ceremony. "However, the most important thing for everybody to remember is the journey continues. Station continues on its way."

Added Russian crewmate Mikhail Tyurin: "It's time to go home."

If Endeavour lands Monday as planned, Culbertson, Tyurin and Russian Vladimir Dezhurov will have spent 129 days in orbit. They moved into the space station in August.

Endeavour pulled away as the spacecraft soared 250 miles above Australia. Its departure was delayed briefly so the shuttle could move the station away from space junk.

A large chunk of a 30-year-old Russian rocket was supposed to pass within three miles of the space station on Sunday — uncomfortably close. NASA had the shuttle pilots steer the station into a slightly higher orbit, creating a gap of more than 40 miles between the outpost and piece of debris.

The extra fuel used in the evasive action forced the shuttle astronauts to shorten their flyaround of the station for a photo survey.

Endeavour spent eight days at the space station. The shuttle crew dropped off thousands of pounds of supplies and loaded the cargo carrier with thousands of pounds of trash and old equipment for return to Earth.