NASA has chosen SpaceX for a daring mission to crash into a “hazardous” asteroid’s moon — knocking it off course.

The rocket firm — helmed by Tesla chief Elon Musk — will begin the mission in June 2021.

But SpaceX won’t actually intercept Didymos’ small “moonlet” until Oct. 7, 2022, when the asteroid will be roughly 7 million miles from Earth.

NASA has been mulling the Double Asteroid Redirection Test (DART) mission for years.

But this week, NASA chose SpaceX as the launch partner for the mission, making use of its capable rocket systems.

NASA describes DART as “the first-ever mission to demonstrate the capability to deflect an asteroid by colliding a spacecraft with it at high speed.”

Simply put, NASA and SpaceX are going to send a probe into space that will “crash into” asteroid Didymos’ moon.

“DART is a planetary defense-driven test of one of the technologies for preventing the Earth impact of a hazardous asteroid: the kinetic impactor,” NASA explained.

“DART’s primary objective is to demonstrate a kinetic impact on a small asteroid.

“While Didymos’ primary body is approximately 800 meters (2,624 feet) across, its secondary body (or “moonlet”) has a 150-meter (492 feet) size, which is more typical of the size of asteroids that could pose a more common hazard to Earth.”

Didymos is officially classified as a “potentially hazardous asteroid” and “near-Earth object,” which means it’s high on NASA’s list of space priorities.

It was first discovered by the University of Arizona in 1996, using a telescope at the Kitt Peak National Observatory.

It orbits the Sun once every 770 days and rotates quickly every 2.26 hours.

NASA’s DART probe will “deliberately crash itself” into the moonlet at about 6km (3.7m)/s.

The probe will be aided by an onboard camera and autonomous navigation software.

NASA hopes that the collision will change the speed of the moonlet in its orbit around the main Didymos asteroid by a fraction of one percent.

This should be enough to measure using telescopes in Earth, allowing NASA to track the success of the mission.

Fortunately, Didymos isn’t destined to hit Earth anyway — but is deemed “hazardous” due to its proximity to our planet.

But NASA proves that its technique could work, asteroid deflection could serve as a vital “planetary defense” system for future generations.

The mission won’t be cheap: it’ll cost NASA $69 million to launch.

But that’s a small price to pay for saving humanity, of course.