If an asteroid hits Earth, our mightiest heroes won't be The Avengers. It may very well be Elon Musk.

NASA announced Thursday that it had awarded a contract to SpaceX, the space exploration company led by Musk, to help it with asteroid deflection via its Double Asteroid Redirection Test (DART) mission.

The contract, which costs $69 million, will be "the first-ever mission to demonstrate the capability to deflect an asteroid by colliding a spacecraft with it at high speed — a technique known as a kinetic impactor," according to a statement from the government space agency.

ANCIENT ASTEROID STRIKES ON MARS MAY HAVE 'PRODUCED KEY INGREDIENTS FOR LIFE'

The asteroid that is being targeted is Didymoon, the small space rock that actually orbits the larger Didymos asteroid. The mission is currently slated for a June 2021 launch on SpaceX's Falcon 9 rocket.

"By using solar electric propulsion, DART will intercept the asteroid Didymos’ small moon in October 2022, when the asteroid will be within 11 million kilometers of Earth," NASA explained.

Separately, SpaceX on Thursday successfully launched its Falcon Heavy rocket, more than a year after sending up a "red Roadster" in its initial test flight. Now the world's most powerful operation rocket with 27 engines firing at liftoff, the Falcon Heavy launched into with Arabsat-6A, a Saudi Arabian satellite built by Lockheed Martin and operated by Saudi Arabia.

NASA congratulated SpaceX in a tweet, saying it will "continue to support the growing commercial space economy." Musk subsequently thanked NASA for the support.

HOW AMERICA CAN GET ITS SLICE OF THE $1 TRILLION SPACE ECONOMY

Didymos defense

Didymos is garnering significant attention this week as the European Space Agency said it is developing a self-driving craft for its Hera planetary defense mission to the asteroid, which could happen as soon as 2023.

“If you think self-driving cars are the future on Earth, then Hera is the pioneer of autonomy in deep space,” Paolo Martino, lead systems engineer of ESA's proposed Hera mission, said in a statement. “While the mission is designed to be fully operated manually from the ground, the new technology will be tested once the core mission objectives are achieved and higher risks can be taken.”

By giving autonomy to Hera, it should let the spacecraft get as close as 200 meters (656 feet) from the surface of Didymoon, which would let it take observations as close as 2 centimeters per pixel.

Hera, which will only start testing the autonomous system once all of the major objectives are complete, is just a small part of the Asteroid Impact and Deflection Assessment (AIDA) mission, according to Space.com.

IRON VOLCANOES MAY HAVE ERUPTED ON METAL ASTEROIDS, STUDY SAYS

The AIDA mission also includes a NASA spacecraft headed to the same asteroid system, where its Double Asteroid Redirection Test (DART) mission is slated to crash into the surface of an asteroid and have two smaller cubesats examine the surface.

Asteroids, disassemble

NASA has recently expanded its planetary defense protocols, including last year's unveiling of a bold new plan to protect Earth.

Last June, NASA unveiled a 20-page plan that details steps the U.S. should take to be better prepared for near-Earth objects (NEOs) such as asteroids and comets that come within 30 million miles of the planet.

Lindley Johnson, the space agency's planetary defense officer, said at the time that the country "already has significant scientific, technical and operational capabilities" to help with NEOs, but implementing the new plan would "greatly increase our nation’s readiness and work with international partners to effectively respond should a new potential asteroid impact be detected.”

In addition to enhancing NEO detection, tracking and characterizing capabilities and improving modeling prediction, the plan also aims to develop technologies for deflecting NEOs, increasing international cooperation and establishing new NEO impact emergency procedures and action protocols.

According to a 2018 report put together by Planetary.org, there are more than 18,000 NEOs.

CLICK HERE FOR THE FOX NEWS APP