A federal judge on Thursday ruled against Jeff Bezos’s Blue Origin in its lawsuit that sought to overturn the NASA contract to build a spacecraft that would fly astronauts to the surface of the moon.

The decision, which was sealed, means NASA could soon proceed to work with Elon Musk’s SpaceX, the winner of the high-profile procurement, as it seeks to return astronauts to the moon for the first time since 1972. (Bezos owns The Washington Post.)

It is another setback in Blue Origin’s attempt to force NASA to award more than one lunar lander contract. The company had previously protested NASA’s decision to the Government Accountability Office, but it too denied the company’s claims that the space agency erred in its decision.

In April, NASA awarded the contract to SpaceX in a decision that stunned many in the space agency since Blue Origin had put together a so-called “national team,” composed of Lockheed Martin, Northrop Grumman and Draper. It had won the most money in the first phase of the contract, and Bezos had taken a personal interest in the program.

In April, however, NASA selected SpaceX and its Starship spacecraft bid of $2.9 billion — half what Blue Origin had proposed charging for the so-called Human Landing System.

In a statement Thursday, Blue Origin said its suit “highlighted the important safety issues with the Human Landing System procurement process that must still be addressed. Returning astronauts safely to the Moon through NASA’s public-private partnership model requires an unprejudiced procurement process alongside sound policy that incorporates redundant systems and promotes competition."

On Twitter, Bezos wrote it was “not the decision we wanted, but we respect the court’s judgment, and wish full success for NASA and SpaceX on the contract.”

NASA said Thursday it would resume work with SpaceX “as soon as possible.” It added that it is working with a number of companies “to bolster competition and commercial readiness for crewed transportation to the lunar surface.” And it said there will be additional opportunities in the future “to partner with NASA in establishing a long-term human presence at the Moon under the agency’s Artemis program, including a call in 2022 to U.S. industry for recurring crewed lunar landing services.”

In the past, Musk has said Blue Origin’s lawsuits were a distraction and that the company needed to focus on its own programs, particularly getting its New Glenn rocket to reach orbit.

In a statement to The Post earlier this year, Musk said Blue’s bid “was just way too high. Double that of SpaceX and SpaceX has much more hardware progress.” He added that Bezos “needs to run BO full-time for it to be successful. Frankly, I hope he does.”

While the case was tied up in the Court of Federal Claims, NASA agreed to stop work on the contract, a pause that some feared could further delay its effort to get back to the moon under its Artemis program.

The space agency has said it hopes to get astronauts there by as soon 2024, an ambitious milestone that won’t be met in all likelihood. In recent months, however, it has made significant progress with the massive Space Launch System rocket that would launch them there. It has stacked the Orion spacecraft on top of the rocket at the Kennedy Space Center in Florida and the entire vehicle is expected to head to the launchpad for tests early next year.

If those go well, the first launch of the SLS rocket could come as soon as February. That mission, known as Artemis I, would send the Orion capsule, without any astronauts on board, in orbit around the moon. If successful, the next flight would fly a similar trajectory, but with crew on board. That would set up the landing mission.

For that to happen, though, SpaceX’s Starship would need to be ready. Musk has said it could be ready for its first orbital test flight this year. But the company first needs approval to launch from its facility in South Texas from the Federal Aviation Administration, which is currently performing an environmental review.