Space shuttle Endeavour undocked from the international space station on Saturday and headed home with three men whose half-year stay set an American endurance record.

"Have a good time, guys," Yuri Onufrienko, the station's departing skipper, told the three new residents left behind. The Russian cosmonaut wished them success and offered a "big thanks to my space brothers," U.S. astronauts Carl Walz and Daniel Bursch.

They're due back on Earth on Monday.

Onufrienko, Walz and Bursch made sure they were on the space shuttle side when the hatches between the two spacecraft swung shut Saturday morning.

Two hours later, Endeavour pulled away, ending a weeklong visit to pick up one space station crew and drop off another, and to fix the orbiting outpost's arthritic robot arm. The parting occurred 250 miles above Kazakhstan.

Space station astronaut Peggy Whitson rang the ship's bell and called out in the tradition of the high seas: "Expedition Four, departing. Endeavour, departing."

"Smooth sailing to you and your crew," replied Bursch, whose own crew was the fourth to inhabit the space station.

Saturday marks the 192nd day in orbit for Bursch, Walz and Onufrienko, the longest space flight ever by Americans. They moved into space station Alpha in early December and moved out last week, after Endeavour arrived with their replacements.

Landing day will be Day 194, a personal record for Onufrienko, whose 1996 mission aboard his country's Mir space station lasted just one day less. A fellow Russian holds the world space endurance record: 438 days.

All three men have already put in an order for pizza; that's what they've been craving for months.

The new space station crew of two Russians and one American will remain on board until October.

On Friday, the astronauts and cosmonauts finished loading a cargo carrier with more than 2 tons of space station garbage and old equipment. They removed the carrier from the station and placed it back aboard the shuttle for return to Earth.

The space station's 58-foot robot arm, a high-tech construction crane, was doing well after receiving a new wrist joint from spacewalking astronauts. But late Thursday, the newly repaired arm was commanded to latch onto the work platform that was installed earlier in the week.

Engineers believe power was flowing from the platform to the arm as intended, but a software glitch prevented confirmation of this. Flight director Paul Hill said the problem will be fixed over the next two weeks.

"It's a relatively simple job," Hill said.

Endeavour spacewalkers Franklin Chang-Diaz and Philippe Perrin said the robot-arm repair work was long and fatiguing – but deeply satisfying.

"We still wake up with smiles on our faces, even though we're tired," Chang-Diaz told reporters Friday evening. "It was a beautiful experience. It was, for me, overcoming."