SpaceX beat Blue Origin and Dynetics to win the contract and become what NASA called its "most trusted private sector partner."
NASA selected SpaceX to land astronauts on the surface of the moon.
The contract, worth $2.9 billion, involves the prototype Starship spacecraft that is being tested at SpaceX's south Texas facility, the agency said Friday.
"Today I'm very excited, and we are all very excited to announce that we have awarded SpaceX to continue the development of our integrated human landing system," said Lisa Watson-Morgan, NASA's Human Landing System program manager.
SpaceX beats out Jeff Bezos' Blue Origin and defence contractor Dynetics to be the sole provider for the system, a surprising break from the past when NASA has chosen multiple companies in case one fails.
Industry analysts said the decision underscores the company, founded by Musk in 2002 with the goal of colonising Mars, as NASA's most trusted private sector partner.
.@NASA has selected @SpaceX to continue the development of its Human Landing System for the #Artemis program.— NASA’s Artemis Program (@NASAArtemis) April 16, 2021
The Human Landing System will take astronauts from lunar orbit to the lunar surface and back. Read the full announcement: https://t.co/tkojemwUUr pic.twitter.com/bvOX6DQsXA
Last year, SpaceX became the first private firm to successfully send a crew to the International Space Station, restoring American capacity to accomplish the feat for the first time since the Shuttle program ended.
For its Moon lander bid, SpaceX put forward its reusable Starship spacecraft, which is designed to carry large crews and cargo for deep space voyages, and land upright both on Earth and other celestial bodies.
Prototypes of the vessel are currently being put through their paces at the company's south Texas facility, though all four versions that have so far attempted test flights have exploded.
Under the Artemis program to return humans to the moon, NASA wants to use the Space Launch System rocket to launch four astronauts on board an Orion crew capsule, which will then dock with a lunar space station called Gateway.
Starship will be waiting to receive two crew members for the final leg of the journey to the surface of the moon.
NASA has selected Starship to land the first astronauts on the lunar surface since the Apollo program! We are humbled to help @NASAArtemis usher in a new era of human space exploration → https://t.co/Qcuop33Ryz pic.twitter.com/GN9Tcfqlfp— SpaceX (@SpaceX) April 16, 2021
The idea is for Gateway to be the go-between but for the initial mission Orion might dock directly with Starship, Watson-Morgan said.
The astronauts would then spend a week on the Moon before boarding Starship to return to lunar orbit, then take Orion back to Earth.
Separately, SpaceX has plans to combine the Starship spaceship with its own Super Heavy rocket, to make a combined vessel that will tower 394 feet (120 metres) tall and be the most powerful launch vehicle ever deployed.
Humanity last stepped foot on the Moon in 1972 during the Apollo programme.
NASA wants to go back and establish a sustainable presence, complete with a lunar space station, in order to test new technologies that will pave the way for a crewed mission to Mars.
In 2019, then vice president Mike Pence challenged NASA to land the first woman and the next man on the moon by 2024, but it's likely that timeline will be relaxed under President Joe Biden.
Another change under the current administration is its stated goal of placing the first person of color on the moon under the Artemis programme.