With a cry of "yippee!" the commander of the orbiting International Space Station told mission control that a contraption for turning urine into drinking water was finally working and the crew were heading to bed.
The astronauts also managed to repair one of the space station's solar arrays that has been out of order for more than a year and, as a result, the right-hand solar wing can now follow the sun automatically to generate electricity for the station.
The running repairs were crucial to plans to sustain six-person crews and increased scientific research on the orbiting international space laboratory. The space-based construction of the station began in 1998 and it has been continuously manned since the first crew arrived in November 2000.
A joint project of the US, Russia, Japan, Canada and 11 European countries, the space station is now about the size of a football field with its solar panels extended. The first six-person crew is to arrive at the station next May.
The attempts to repair the water purification system did not start well. For five frustrating days the $154m (£100m) piece of equipment failed repeatedly while being tested. Problems with a high-speed centrifuge used to separate the water from urine and other body fluids meant the equipment kept shutting down.
Finding a way of producing fresh drinking water on board is vital to plans to double the crew of the space station from three to six next year. Nasa decided to extend the shuttle Endeavour's mission by one day to a 16th day giving the astronauts more time to fix the system which was installed last week. The extra day in space meant the shuttle and station crews – eight men and two women – will spend tomorrow's Thanksgiving holiday together.
The Endeavour will now leave on Friday and is now due to land at Kennedy Space Centre in Florida on Sunday afternoon.
After some high altitude monkey-wrenching by Commander Mike Fincke and astronaut Don Pettit, the system water purification tested successfully. The astronauts removed vibration grommets used to mount the system's distilling centrifuge inside the urine processor and added a few brackets. That did the trick.
"Not to spoil anything, but I think up here the appropriate words are 'yippee'" Mr Fincke told mission control early this morning, shortly before heading to bed.
"There will be dancing later," mission control replied.
The crew members and Endeavour's astronauts were also told to tiptoe around the complex if they woke up in the middle of the night so as not to create vibrations during the test.
The system turns astronauts' body fluids into clean drinking water. Years of design work have gone into the equipment, which should reduce the quantity of fresh water that has to be ferried to the space station. Samples of the purified water produced in the trial runs will be tested back on Earth before astronauts can start drinking it.Reuse content