NASA astronauts replaced a pump during an emergency spacewalk to stop an ammonia leak at the International Space Station's power system.
The emergency repair job on Saturday was shown on NASA television and news of the mission's success was tweeted from space.
About three hours into the spacewalk, which had been expected to last six and a half hours, flight engineers Tom Marshburn and Chris Cassidy had completed the repairs, a NASA commentator said.
The old box, which they had just removed, was suspected to be the source of an ammonia leak that affected the US segment of the orbiting laboratory on Thursday.
Ammonia is used to cool the station's power system.
The new pump was turned on about an hour later, and after about 30 minutes of observation, ISS commander
Canadian Chris Hadfield tweeted: "No leaks! We're bringing Tom & Chris back inside."
Officials said the emergency spacewalk set a precedent because it was conducted at such short notice.
It was the 168th excursion in support of the orbiting laboratory and the fourth for both Marshburn and Cassidy, who have worked together before.
Both US and Russian officials stressed that spacewalks are usually taxing tasks involving ISS crews and control mission on the grounds.
Hadfield, overseeing the mission, tweeted that it is "a workout" to wear a spacesuit which the Russian Space Agency said weighs more than 100 kg.
"The reason they regularly check their gloves is for damage. Even though multi-layer, even a tiny leak requires immediate haste to airlock," Hadfield said on Twitter.
NASA has stressed that the lives of the multinational crew were not in danger, but both Russian and US space experts called the leak "serious."
It is thought the leak was caused when a meteorite or a piece of debris hit the cooling radiator.
Hadfield, Marshburn and Russian cosmonaut Roman Romanenko are due to return to Earth early on Tuesday after completing their half-year stint aboard the station.
Cassidy is also scheduled to perform two spacewalks in July, NASA said.