Boeing’s Starliner spacecraft landed softly in the New Mexico desert Sunday morning, successfully finishing a flawed test mission that went awry shortly after the capsule reached space.

Floating under three parachutes, the spacecraft, which was carrying no astronauts, touched down in the predawn darkness at 7:58 a.m. Eastern time at the White Sands Missile Range.

Boeing and NASA celebrated the return of Starliner as a triumph, the first time an American capsule built to send human beings to orbit touched down on land instead of in the ocean.

“There’s no point of sending people to space if you can’t bring them home safely,” Boeing spokesman Josh Barrett said during Internet coverage of the landing.

At a news conference after the landing, Jim Chilton, Boeing’s senior vice president for space and launch, said: “Today couldn’t have gone any better. … We are just as pleased as we can be with the design.”

The soft landing capped a mission that had suffered a significant failure when the spacecraft’s timing system prevented it from performing a key test objective: reaching the International Space Station and docking with the flying laboratory in orbit at 17,500 mph. NASA and Boeing officials said that now that they have recovered the spacecraft, they will investigate what went wrong and why.

Chilton said Sunday that the timer was significantly off — an 11-hour discrepancy between what the spacecraft’s internal clock was reading and what the actual time was. He did not say what could account for such a big difference. A Boeing spokesman said the company is still “diving into the data” to figure out what went wrong.

“Make no mistake, this did not go according to plan in every way that we would have hoped,” NASA Administrator Jim Bridenstine said at the news conference. But he added that the mission still achieved a number of key objectives, including the landing, which he said was “an absolute bull's eye. … Overall we learned a lot, but there’s a lot more learning left to do."

NASA is relying on Boeing and SpaceX to design and build spacecraft capable of flying its astronauts to the space station. Before they undertake missions with NASA astronauts on board, both companies are to fly uncrewed missions to test how their capsules operate in space.

SpaceX completed a successful flight without astronauts on board in March. But a month later its Dragon spacecraft exploded during a test firing of its emergency abort system engines. The company says it has since fixed that problem and is hoping to perform a test of the abort system in-flight next month.

Boeing’s mission got off to a good start, when Starliner launched successfully early Friday morning on an Atlas V rocket, operated by the United Launch Alliance, from Cape Canaveral on Florida’s Space Coast.

But when the spacecraft was released, a problem with its timing system caused the engines not to fire as expected. That put the spacecraft in the wrong orbit, where it was between communications satellites. Because it was in the wrong location, its antennae were unable to receive commands from the ground to correct the error, Chilton said.

As the spacecraft struggled to put itself on the correct flight path, it fired a series of thrusters that burned up fuel, and NASA and Boeing decided that the spacecraft should not attempt to dock with the station.

Starliner had been scheduled to spend about a week attached to the space station but instead was forced to come home early. Early Sunday morning, Starliner fired its engines once again, this time to slow it down to reenter the atmosphere. The spacecraft slammed into the atmosphere at about 25 times the speed of sound. Its heat shield withstood 3,000-degree temperatures, as the spacecraft was engulfed in a fireball generated by high-speed friction with the increasingly dense atmosphere.

Nearing Earth, the spacecraft deployed its parachutes — another key test since the company had struggled with the system previously — and touched down softly.

Before the landing, Chilton said that the company was optimistic but that re-entries and landings “are not for the faint of heart.” The spacecraft was able to successfully perform a number of key tests, he said, that Boeing and NASA officials hope will help pave the way for a flight with crews on board.

It’s not clear, however, if NASA will require the company to fly another test flight without crews before allowing its astronauts on board. NASA and Boeing officials said that it was too early to say and that they needed to first review all of the data from the flight.

Chilton said that if the company did have to fly another test flight without astronauts, it would delay the program by “three months, minimum.”

Bridenstine, the NASA administrator, said the problems the spacecraft suffered at the beginning of its flight will require additional scrutiny.

“That gives us reason to think we need to go back and look at a lot of different things,” he said.