HOUSTON — A Russian Soyuz space capsule landed safely on Earth May 24, returning three veteran spacefliers home after a five-month mission to the international space station and a unique photo opportunity for the station and NASA’s shuttle Endeavour.

The Soyuz carrying Russian cosmonaut Dmitry Kondratyev, NASA astronaut Cady Coleman and Italian astronaut Paolo Nespoli landed on the steppes of Kazakhstan at 10:37 p.m. EDT May 24 in their Russian Soyuz spacecraft.

All three were reportedly in good health and spirits after 157 days in space. NASA officials said the Soyuz landed upright instead of tilting over its side due to winds in a rare, smooth touchdown.

The trio undocked from the space station at 5:35 p.m. EDT, leaving behind three crewmates — NASA astronaut Ron Garan and Russian cosmonauts Andrey Borisenko and Alexander Samokutyaev — and six visiting astronauts from Endeavour.

This was the first time that a Soyuz undocked from the space station while one of NASA’s space shuttles was also attached to the orbiting laboratory. To mark the occasion, the departing astronauts conducted a special photo opportunity of Endeavour and the station.

After undocking, Kondratyev backed the Soyuz away and held the spacecraft stationary at a point approximately 200 meters from the station. Nespoli then moved to the upper module of the Soyuz and positioned himself at a window to take a series of still images and video of the stunning view for about 20 minutes.

The only other time a space shuttle was photographed at a space station was when the shuttle Atlantis was snapped while undocking from the Russian Mir space station on July 4, 1995, near the end of its STS-71 mission, said NASA spokesman Rob Navias.

The unique pictures of Endeavour at the space station will be a poignant reminder of the legacy of NASA’s space shuttle program, and the international cooperation that made construction of the space station possible.

“This is the first time we’ve ever done something like this,” lead shuttle flight director Derek Hassman told reporters May 24. “It’s unprecedented and we’ve worked hard to get here. From a big picture perspective, it demonstrates the partnership we have with our Russian colleagues and the things we can accomplish when we work together.”

Endeavour launched May 16 to fly one last space voyage before being retired. The shuttle’s six-man crew is on a 16-day mission to help support station operations following the end of NASA’s space shuttle program.

Prior to the Soyuz undocking, an issue was detected with an electrical box that is used to house data from onboard payloads, store digital imagery and send files between the station and the ground. Garan worked later than expected to work on the cables, and when the shuttle crew woke up that evening, they replaced the box to resolve the issue.

About five or six hours of data were lost as a result, space station flight director Dana Weigel said, and payloads throughout the station were affected. To compensate for Garan’s extra work, mission managers allotted an extra three hours of sleep for the station resident.

Once the issue was resolved, the main focus reverted back to the undocking operations for the three returning astronauts.

Kondratyev, Coleman and Nespoli launched to the international space station Dec. 15, 2010. They arrived at the orbiting outpost two days later.

During their time on orbit, Kondratyev, Coleman and Nespoli oversaw the last visits of two space shuttles — Discovery’s final STS-133 mission in February, and Endeavour’s STS-134 finale, which docked at the station May 18.

The Soyuz departure leaves Garan, Samokutyaev and Borisenko aboard the station to host Endeavour’s crew until they undock from the orbiting laboratory May 29. After that, the space station will be home to only three astronauts until the arrival of three new crewmembers in June.

Russian cosmonaut Sergei Volkov, NASA astronaut Mike Fossum and Japanese astronaut Satoshi Furukawa are scheduled to launch into orbit June 7. They are slated to arrive at the space station two days later.

Prior to his departure, outgoing station commander Kondratyev turned command of the outpost over to fellow Russian cosmonaut Borisenko, who will preside over the station’s Expedition 28. The arrival of Volkov, Fossum and Furukawa will round out the new expedition’s crew.