CAPE CANAVERAL, Fla. — Boeing, still reeling from the crashes of two passenger jets that killed 346 people and led to the worldwide grounding of its most popular aircraft, suffered another major setback Friday when the craft it is designing to fly NASA astronauts to space failed to achieve the correct orbit, forcing the cancellation of its planned mission to the International Space Station.

Officials said they were investigating what caused the Starliner capsule’s main engine not to fire as scheduled to push it onto a path to rendezvous with the space station. But suspicion immediately fell on the capsule’s software, which was directing the spacecraft’s operations after launch.

No one was aboard the spacecraft and no one was hurt, but the problem reignited questions about Boeing’s procedures as NASA seeks to restore human spaceflight from U.S. soil. No American has flown into space from the United States since the space shuttle fleet was retired in 2011.

Boeing spokesman Gordon Johndroe said in an email to The Washington Post that there is “no direct comparison” between the Starliner’s failure on Friday and the two deadly crashes of 737 Max airliners, which were blamed on a software program called the Maneuvering Characteristics Augmentation System, or MCAS. Spaceflight software development “utilizes different approaches and people due to the unique mission demands and conditions,” Johndroe said.

But questions are sure to arise around whether Boeing’s divisions might share approaches to design, testing and evaluation that could result in shared problems with software, said Todd Curtis, an aviation safety analyst for the website AirSafe.com and a former Boeing engineer.

“Although they are different divisions, they are the same company, and they are in these spaces where assets from one part of the company can be used in a completely different part of the company,” Curtis said. He recalled that during his time in the commercial plane division, he was sometimes called on to help out with issues in the military aviation division.

“They can be working off shared documentation, shared procedures, or shared staff, or other shared resources used in different parts of the company,” he said. “Even though this is a space story today, 737 Max’s problems are in the back of people’s minds.”

Loren Thompson, a defense analyst who works with Boeing as well as some of its competitors, suggested Boeing’s problems with the 737 Max would inevitably affect Boeing’s other businesses.

“One thing that has allowed Boeing to take risks on the defense and space side is robust cash flow from their jetliner business,” Thompson said. “Now that that has been impaired, they may have to pull in their horns from taking risks."

Boeing shares have tumbled 22 percent since the second crash of a 737 Max in March, erasing about $52 billion of its market value. The stock price fell more than 1.6 percent Friday, closing at $328 a share.

The failure of the Starliner capsule to achieve the correct orbit came after what appeared to be a flawless on-time liftoff at 6:36 a.m. Friday. The Atlas V rocket, operated by the United Launch Alliance, took off just before dawn. After a few minutes, the first engine cut off, the second stage took over, and finally the spacecraft was flying freely. At 31 minutes after launch, the Starliner’s main engine was supposed to ignite. It did not.

Boeing and NASA officials said they were gathering details about what went wrong and why, as they seek to bring the spacecraft back to the ground, most likely Sunday in New Mexico. The original plan had been for the craft to dock with the space station on Saturday, deliver holiday presents and supplies, and return to Earth on Dec. 28.

Officials painted a complicated picture of multiple miscues aboard the craft: In addition to the failure of the spacecraft’s computer to fire the engine to push it into the correct orbit, a timer aboard the spacecraft mistakenly thought that “orbital insertion burn” had taken place and ordered other thrusters to fire to keep the spacecraft on a straight and true trajectory.

By the time the crews on the ground figured out what was wrong and sent corrective instructions to the spacecraft, it had burned through so much fuel that officials decided they would need to abort the mission to the station and bring the spacecraft down.

NASA Administrator Jim Bridenstine said at a news conference Friday that the failure would not have been life-threatening had astronauts been onboard. He said that had the spacecraft been crewed, the mission might have been saved. “They are trained to deal with a situation where the automation is not working according to plan,” he said.

Bridenstine praised the quick thinking and professionalism of Boeing as it struggled to deal with a troubling situation. He and others said finding problems was the precise reason for the test program. On Thursday, he said he had complete confidence in Boeing.

“We’re very comfortable with Boeing as a company,” he said. “Look at the history that Boeing has delivered on behalf of the United States of America. There is a lot of history here. There is a lot of capability here.”

He added that NASA’s engineers had been “embedded side by side with Boeing’s engineers” and that “every piece of this spacecraft is being certified by NASA.”

The failure of the Starliner capsule comes at one of the darkest moments in Boeing’s more than 100-year history. The 737 Max remains grounded, nine months after the plane’s second crash in Ethiopia, and a fix first promised by April has yet to be approved as more problems have come to light. Boeing’s chief executive, Dennis Muilenburg, was stripped of his title as chairman. One member of Congress, incensed over the problems with the 737 Max, accused the company of building “flying coffins.”

On Monday, Boeing announced it would halt production of the troubled airplane beginning in January, a hit to its bottom line that could send ripples across the U.S. economy. Southwest Airlines, the largest customer for the 737 Max, announced Tuesday it would not plan to fly the planes until April, and on Friday, United Airlines said it was pulling 737 Max jets from its flight schedules until June 4.

“We won’t put our customers and employees on that plane until regulators make their own independent assessment that it is safe to do so,” United spokesman Frank Benenati said in an email.

United has 14 737 Max jets in its fleet and is waiting on delivery of an additional 16, Benenati said.

Boeing also has suffered a number of problems with its Starliner spacecraft, originally scheduled to fly crews into space in 2017.

Last year, it discovered a propellant leak during a test of the capsule’s abort motor. The company fixed that problem, it said. But then last month, during a test of its abort systems, one of the three parachutes failed to deploy, apparently because someone had failed to hook the main chute to a drag chute that pulls it from the capsule.

Since the space shuttle was retired in 2011, the space agency has relied on Russia to ferry its astronauts to the space station, about 240 miles above Earth. Those seats cost about $84 million each.

In 2014, Boeing and SpaceX won contracts, worth $6.8 billion combined, to build spacecraft designed to restore human spaceflight from U.S. soil.

In March, SpaceX successfully flew its Dragon spacecraft without crews to the space station, and it is hoping to complete a test of its emergency abort system in January.

Before Friday’s launch, Bridenstine was bullish about the progress both companies were making and optimistic about the future.

“We’re moving into a new era,” he said Thursday. “We are going to launch American astronauts, on American rockets, from American soil for the first time since the retirement of the space shuttles.” The first flight with astronauts aboard, he said, would take place “in the first part of next year.”

Officials on Friday could not say what the next steps will be.

Jim Chilton, Boeing’s senior vice president for space and launch, said the company will focus on finding the “root cause of the failure” but said “we don’t know why” the timer misfired. “The spacecraft was not on the timer we expected it to be on,” he said. “That was a surprise.”

It was unclear whether NASA would require Boeing to fly another test mission without crews onboard before allowing its astronauts to fly in the Starliner. Bridenstine said he wouldn’t rule out a mission with crews onboard, pointing out that the space shuttle had been piloted by astronauts, not computers.

A statement from Vice President Pence, the Trump administration’s point on crewed spaceflight, suggested the failure will not disrupt NASA’s schedule to fly Americans from U.S. soil next year. The statement said Pence had been briefed by Bridenstine, who assured him that “NASA will continue to test and improve, in order to return American astronauts to space on American rockets in 2020.”