A new video reveals just how close NASA came last year to losing its $500 million Fermi Gamma-ray Space Telescope in a narrowly averted collision with a defunct, Cold War-era Soviet spy satellite.

On March 29, 2012, Julie McEnery, the project scientist for Fermi, received an automatically generated email warning that the two satellites were due in just a few days to pass within 700 feet of one another as their respective orbits crossed.

"My immediate reaction was, 'Whoa, this is different from anything we've seen before,' " McEnery recalls.

The danger to Fermi came from Cosmos 1805, a spy satellite launched in December 1986 that was no longer functional, but still speeding around the Earth at 15,000 mph.

According to NASA:

"Although the forecast indicated a close call, satellite operators have learned the hard way that they can't be too careful. The uncertainties in predicting spacecraft positions a week into the future can be much larger than the distances forecast for their closest approach."This was most dramatically demonstrated on Feb. 10, 2009, when a study revealed that Cosmos 2251, a dead Russian communications satellite, would pass about 1,900 feet from the functioning Iridium 33 communications satellite later in the day. At the predicted time of closest approach, all contact with Iridium 33 was lost. Radar revealed clouds of debris traveling along the orbits of both spacecraft, confirming the first known satellite-to-satellite collision."That crash generated thousands of fragments large enough to be tracked and many smaller pieces that evade detection. Much of the wreckage remains a hazard to operating spacecraft because only about 20 percent of the trackable pieces have reentered the atmosphere."

Fermi Attitude Control Lead Engineer Eric Stoneking says Cosmos 1805 is just one example of all kinds of space junk that pose a danger to space probes such as Fermi.

They include intact orbiting satellites that, like Cosmos, are no longer operating, and even "old parts and ... debris down to flecks of paint," he says.

"If you see a piece of debris far enough in advance, you can decide to alter your orbit to make sure that your orbit and its orbit don't intersect and that there isn't a collision," Stoneking says.

So that's what he and the rest of the Fermi team set out to do. But the only way to do it was to fire Fermi's attitude thrusters, which were designed for an eventual de-orbit burn, to allow the huge satellite to safely burn up over the ocean after its scientific usefulness was over.

But any failure of the untested thruster system would have been as equally catastrophic as an impact with the Soviet satellite.

"You can't help but be nervous thinking about highly flammable fluids heading down pipes they'd never flowed down before," McEnery says. "But having done this, we now know the system works as designed, and it gives us confidence should we need to maneuver again in the future."

Scientists ordered Fermi to park its solar panels and pack up its high-gain antenna to protect them during the critical, one-second firing of the thrusters.

"There was a lot of suspense and tension leading up to it, but once it was over, we just sighed with relief that it all went well," McEnery says.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.