The vastness of space is very different from the claustrophobic darkness of a Chilean mine. But when 33 men became trapped in the earth, Chile's government asked for help from NASA, an organization whose specialty is leaving the earth.
The Chile experience has been a ray of light for NASA, whose people may feel they sometimes are trapped in darkness themselves. While the agency has expertise that helped in the mining drama -- for instance, how to take care of people in confined places (like astronauts) -- its primary mission (where to send those astronauts next) has been muddled, the subject of acrimonious debate between the Obama administration and members of Congress.
The space agency provided Chile with two doctors, a psychologist and a team of engineers who provided advice on how to design the miners' escape capsule -- the cramped tube, nicknamed "Phoenix," that was used to pull the men, one by one, from the ground.
Clinton Cragg, a former Navy submarine commander who now heads a NASA troubleshooting team, went to the mine site, returned to NASA's Langley Research Center in Virginia, and assembled a team to draw up safety guidelines for Phoenix.
"You try to think of everything you can think of that can go wrong, and you try to put something in the design to mitigate or deal with that," he said in an interview with ABC News.
"There's been a certain amount of incredulity: Why would NASA be involved in a mine accident?" said Roger Launius, the agency's former chief historian, who now is a senior curator at the Smithsonian Institution's National Air and Space Museum. "But as an agency with broad experience, it makes sense that they'd be asked to help out."
Experts say NASA can be very, very effective when its mission is clear. It sent astronauts to the moon only eight years after John F. Kennedy ordered them to try. Its robotic probes have explored the planets.
But since the glory days of Apollo, the space program has struggled to find clear goals for its astronauts. Their future has been hotly debated this year -- one reason a success in Chile has been so welcome.
After the space shuttle Columbia and its crew were lost in 2003, President George W. Bush ordered that NASA end the shuttle program by 2010 and start a new one, called Constellation, to send astronauts back to the moon and eventually on to Mars.
In a compromise signed just this week, it agreed with Congress to mount an expedition to a passing asteroid in the 2020s, and perhaps go to Mars after that.
Caught in the middle are tens of thousands of NASA workers, some on the agency payroll, others who work under contract to NASA for aerospace firms. The agency's budget actually has gone up under the Obama administration, but in the years of uncertainty over NASA's future direction, there's been a gradual brain drain from the space business.
"The first thing that happens in such times is a hiring freeze," said Launius, "and that means new blood isn't coming into the system. There aren't young people with fresh ideas.
"Second," he said, "through early retirement and the like, they push out the more senior people at the top. So you lose the people with knowledge and experience. And you're left with the people in the middle."
Launius said this has happened several times since the end of the Apollo moon project.
In the last month, contractors have started layoffs at NASA centers in Florida, Alabama and elsewhere, despite the protests of many senators. So even though the Chilean rescue only involved a relative handful of NASA people, it came at a good time for the space program.
"I am proud of the people of this agency who were able to bring the experience of spaceflight down to Earth when it was needed most," said NASA's administrator, Charles Bolden, in a press statement.
Clinton Cragg, the engineer who worked on the rescue pod, did repeated interviews after the first miners were safe, including one for NASA's own public affairs operation.
"Our agency really has a lot of exceptional people," he said on NASA Television. "I mean, 20 or so engineers who offered to drop everything for three days to come up with the list of requirements for that capsule, I think, really exemplifies everything that NASA stands for."
ABC News' Bojana Zupan contributed information for this story.