International Space Station (ISS) crew took refuge in two Soyuz escape capsules as a piece of space junk drifted nearby.
The debris – a discarded piece of Russian rocket – was detected on Friday when it was too late to move the ISS.
NASA said the debris was barely close enough to be a threat but that precautionary measures had to be taken.
It is the third time in 12 years that the ISS has faced a possible collision with space junk.
In June 2011, a piece of debris came within 335 m (1,100 ft) of the platform.
The ISS is currently manned by three Russians, two Americans and a Japanese astronaut.
They were ordered by ground control to move into two Soyuz escape capsules in case the station was hit, but a NASA spokesman said they were given the green light to return to the main station at 02:38 GMT on Saturday.
The “sheltering exercise” was carried out with “due diligence and in a very precautionary and conservative fashion”, said the unnamed spokesman.
“Everything went by the book and as expected, the small piece of cosmos satellite debris passed the international space station without incident.”
Russia’s space agency said the debris had passed the station at a distance of 23 km (14 miles).
“The cosmonauts have returned to performing their previously assigned work,” an official told Interfax news agency.
NASA says it is actively tracking some 22,000 pieces of space debris, but there are millions of objects left over from decades of space travel drifting in Earth’s orbit.
They range in size from smaller than a centimetre across to large chunks of rockets, defunct satellites or discarded fuel tanks.
All are travelling at several kilometres per second and could cause serious damage to the ISS or vital satellites if they collided.
The single biggest debris-generating event happened in 2007, when China used a missile to destroy one of its own satellites. The explosion created more than 3,000 trackable objects and an estimated 150,000 debris particles.
Then in 2009, a Russian and American satellite collided, releasing tons of debris.
Attempts are being made to avoid such incidents happened again by drawing up an international code of conduct for space exploration.
The US announced in January that it was backing EU countries in working towards the code to address long-term safety and security concerns and establish “guidelines for the responsible use of space”.
Countries backing the code would also commit to exploring space for peaceful purposes only and to not attacking each other’s satellites.
But critics say such a code would not be legally binding, and concerns remain about countries being obliged to share information on satellites used for military purposes.
India, China and Russia, all of which have advanced space programmes, have not yet said they will back the code.