NASA on Friday selected Elon Musk’s SpaceX to build spacecraft that would land astronauts on the moon for the first time since the last Apollo mission.

The award to SpaceX for the “human landing system” was a stunning announcement that marked another major victory for the hard-charging company that vaults it to the top tier of the nation’s aerospace companies and solidifies it as one of the space agency’s most trusted partners.

In winning the $2.9 billion contract, SpaceX beat out Jeff Bezos’s Blue Origin, which had formed what it called a “national team” by partnering with aerospace giants Lockheed Martin, Northrop Grumman and Draper. SpaceX also won over Dynetics, a defense contractor based in Huntsville, Ala. (Bezos owns The Washington Post.)

NASA had originally chosen all three companies for the initial phase of the contract, and was expected to choose two of them to build the lunar lander. In other major programs, NASA has chosen multiple providers to foster competition and to ensure it has redundancy in case one can’t deliver.

In a document explaining NASA’s rationale for picking SpaceX obtained by The Washington Post, NASA said it wanted “to preserve a competitive environment at this stage of the HLS Program.” But it added that “NASA’s current fiscal year budget did not support even a single [contract] award.” As a result, SpaceX updated its payment schedule so that it now fits “within NASA’s current budget.”

But in moving ahead with SpaceX alone, it sent a message that it fully trusts the growing company to fly its astronauts for its signature human exploration program — Artemis, a campaign to return astronauts to the moon for the first time since 1972.

“As the first human lunar lander in 50 years, this innovative human landing system will be a hallmark in space exploration history,” Lisa Watson-Morgan, NASA’s lunar lander program manager, said during a news briefing announcing the award. “NASA’s Apollo program captured the world’s attention, demonstrated the power of America’s vision and technology, and can-do spirit. And we expect Artemis will similarly inspire great achievements, innovation and scientific discoveries. We’re confident in NASA’s partnership with SpaceX to help us achieve the Artemis mission.”

Video shows SpaceX's Starship SN10 prototype successfully launch and return to a soft landing on March 3. (SpaceX)

Over the past several years, SpaceX, founded by Musk in 2002 with the goal of eventually flying humans to Mars, has completely upended the space industry, moving through fast, and at times fiery test campaigns that have unsettled traditional industry officials but also ignited new waves of enthusiasm not seen since the early days of the Space Age.

When Musk first started the company, even he didn’t think it would succeed. In 2008, after three test flights of its Falcon 1 rocket failed to reach orbit, he was nearly out of money. But the next test was successful, and NASA awarded the company a modest contract that kept it afloat.

In the years since, SpaceX has flown cargo and supplies to the International Space Station, and then, astronauts, overcoming skeptics who said human spaceflight should never be outsourced to the private sector, and certainly not to a company as green — and brash — as SpaceX.

In 2015, one of its Falcon 9 rockets exploded on a mission for NASA flying cargo to the station. Another exploded on the launchpad ahead of an engine test in 2016. And after Musk smoked pot on a podcast broadcast on the Internet, then-NASA Administrator Jim Bridenstine ordered a safety review of the entire company.

But despite the setbacks, SpaceX has achieved enormous success — flying astronauts safely and dominating the launch market, while lowering the cost and dramatically increasing the number of flights.

For the Artemis program, SpaceX bid its reusable Starship spacecraft, which is being designed to fly large numbers of people into deep space and land on celestial bodies as well as back on Earth.

On Twitter, the company said it is “humbled to help @NASAArtemis usher in a new era of human space exploration.” In a statement, Blue Origin said its “National Team doesn’t have very much information yet. We are looking to learn more about the selection.” Dynetics did not respond to requests for comment.

The company has been putting its Starship spacecraft through a fast-paced test campaign at its facility in South Texas, launching prototypes without any people on board several miles up in the air, then flying them back to a landing site.

So far, all the test vehicles have crash-landed in a series of fireballs that triggered investigations overseen by the Federal Aviation Administration. But the company is expected to try again soon with a test vehicle that Musk has said is outfitted with several upgrades. And it hopes to be able to fly the spacecraft to orbit this year.

SpaceX was one of two providers hired by NASA to fly its astronauts to the International Space Station. It flew two missions with astronauts last year and its next mission scheduled to launch on Thursday. Boeing, the other company hired to ferry crews to the station and back, has stumbled badly and has yet to fly a test mission with astronauts.

That experience shows why NASA is best served by having at least two providers on major programs, officials said, and the pressure will be on SpaceX to perform. According to the document explaining the decision, SpaceX’s bid “was the lowest among the offerors by a wide margin.” NASA also liked Starship’s ability to ferry a lot of cargo to and from the surface of the moon as well, which it said “has the potential to greatly improve scientific operations.”

While the contract will cover the first human landing, Watson-Morgan said NASA “will also begin work immediately on a follow-up competition” to “provide regularly recurring services to the lunar surface that will enable these crewed missions on sustainable basis.”

The Artemis program began under the administration of former president Donald Trump but has been embraced by the Biden administration, though the White House is reconsidering the timeline. Trump had ordered that astronauts land on the moon by 2024, a schedule the White House now says is under review as NASA works to develop its rockets and spacecraft. It is also working with Congress to get the funding it needs.

For this fiscal year, Congress appropriated $850 million for the effort — well short of the $3.3 billion NASA said it needed to meet the 2024 timeline.

Earlier this month, the Biden administration proposed a $24.7 billion budget for NASA, a 6.3 percent increase that included an additional $325 million for the Artemis program.

Acting NASA Administrator Steve Jurczyk praised the request and said it “supports the development of capabilities for sustainable, long-duration human exploration beyond Earth, and eventually to Mars.”

Previously NASA vowed that it would land a woman on the moon as part of the first Artemis lunar landing. But in his statement, Jurczyk said the agency would also include the “first person of color” as part of the program.

The White House recently nominated former Florida Sen. Bill Nelson (D) to lead the agency. His confirmation hearing is scheduled for next week, and he is expected to win confirmation easily. During his time in Congress, Nelson was a strong advocate for space exploration, and he flew on the space shuttle in 1986 as a member of the House. If confirmed, he has said he would push to get the funding the Artemis program needs, as the agency reassesses the timeline for returning astronauts to the moon.

Also on Friday, the White House said it would nominate former NASA astronaut Pamela Melroy, a retired Air Force colonel, to be the space agency’s deputy administrator.

The contracts for the lunar landers come a year after NASA awarded three initial contracts to Blue Origin, Dynetics and SpaceX.

In awarding those contracts, NASA said Blue Origin and its team was furthest along and awarded it the largest contract, $579 million. Dynetics, which is partnering with the Sierra Nevada Corp., received $253 million, and SpaceX won $135 million.

The defeat is a huge blow to Blue Origin, and to Bezos, who has long been fascinated by the moon and has for years wanted to be part of the effort to return there. He has said that watching Neil Armstrong and Buzz Aldrin walk on the moon when he was 5 years old was “a seminal moment” for him.

Blue Origin has been pitching its landing system, known as Blue Moon, since 2017, and Bezos has said he would invest in it heavily himself. In 2019, Bezos said that the program is “so ambitious that it needs to be done with partners. This is the only way to get back to the moon fast. We’re not going back to the moon to visit. We’re going back to the moon to stay.”