Nuclear weapons were developed for offensive purposes, but the technology could prove to be a wonderful defense from otherworldly visitors as well. In a new initiative, researchers from NASA have teamed up with the Energy Department and the National Nuclear Security Administration to outline a plan that would save the Earth from an asteroid impact with the help of a nuclear weapon.

Accomplishing this lofty goal would require the construction of an entirely new kind of spacecraft. Called the Hypervelocity Asteroid Mitigation Mission for Emergency Response (or HAMMER for short), the vehicle would be designed as a dual-purpose piece of hardware. For smaller hazardous space rocks, the vehicle would simply collide with the object and nudge it off course, but for larger ones it would carry a nuclear payload that would dramatically increase its ability to push the rock away.

In order to better plan out how such a vehicle would interact with its intended target, the scientists used the asteroid known as Bennu for an in-depth case study. Bennu, a rather large rock with a diameter of around 500 meters, is the star of NASA’s OSIRIS-REx mission which will see a small probe land on the asteroid, retrieve a sample, and then return from Earth. Since so much is already known about Bennu, it was considered the best candidate for the research. The work was published in the journal Acta Astronautica.

For asteroids spotted long enough in advance, the non-nuclear impactors are the preferred strategy. Several of the asteroid pushers could gradually slow the rock and allow the Sun’s gravity to pull it off of its deadly course. However, for last-second asteroid emergencies, a high-powered nuclear option would potentially be able to divert a much closer rock.

Aside from being the test subject for the hypothetical HAMMER spacecraft, Bennu might actually be the first rock to pose a real threat to Earth in the not-so-distant future. Its current trajectory will bring it back towards our planet in 2135, and NASA says there’s a very small chance it could actually hit us. In a situation such as that, an asteroid defense system would obviously be a great asset.

The team is scheduled to present their plan later this year at a conference in Japan, but whether the HAMMER system will actually be funded and built is still up in the air.