The agency had insisted for a couple of months that it was confident that Suni Williams and Butch Wilmore would return on Starliner.

For weeks, NASA has downplayed problems experienced by Starliner, a Boeing spacecraft that took two astronauts to the International Space Station in June. But on Wednesday, NASA officials admitted that the problems with the spacecraft were more serious than first thought, and that the astronauts may not travel home on the Boeing vehicle, after all.

The agency is exploring a backup option for the astronauts, Suni Wiliams and Butch Wilmore, to hitch a ride back to Earth on a vehicle built by Boeing’s competitor SpaceX instead. Their stay in orbit, which was to be as short as eight days, may extend into next year.

“We could take either path,” Ken Bowersox, NASA’s associate administrator for the space operations mission directorate, said during a news conference on Wednesday. “And reasonable people could pick either path.”

The announcement adds more headaches and embarrassment to a troubled year for Boeing, an aerospace giant that has billions of dollars of federal contracts in defense and space and that builds commercial jets flown around the world. In addition to the substantial woes faced by the company’s civil aviation division, Boeing announced on Thursday that it was writing off $125 million spent on the Starliner program, adding to $1.5 billion of earlier unexpected costs.

NASA and Boeing officials had maintained that the crew that launched with Starliner on its first crewed test flight was not stranded in space. Ms. Williams and Mr. Wilmore have spent two months aboard the orbital outpost while engineers continue to analyze data about the faulty performance of several of the Starliner’s thrusters when it approached for docking.

Under the contingency plan, a SpaceX Crew Dragon capsule would travel to the space station with two astronauts instead of its planned crew of four. Ms. Williams and Mr. Wilmore would then join as full-time members of the space station crew for a half-year stay, returning on the Crew Dragon around next February.

“In the last few weeks, we have decided to make sure we have that capability there, as our community, I would say, got more and more uncomfortable,” said Steve Stich, the manager of the commercial crew program at NASA.

NASA officials said no decision had been made yet.

A satellite image shows the International Space Station docked with the Boeing Starliner spacecraft on June 7.Maxar Technologies, via Reuters

That Crew Dragon launch has been pushed back to no earlier than Sept. 24 to allow more time for NASA officials to contemplate what to do with Starliner. The SpaceX launch had been scheduled for Aug. 18.

Boeing released a statement on Friday that indicated the company thought it had provided enough information to show the spacecraft would be able to take Ms. Williams and Mr. Williams back to Earth safely, listing a litany of work that has been performed over the past two months.

“Our confidence is based on this abundance of valuable testing from Boeing and NASA,” the statement said.

But if the contingency alternative comes to pass, the Boeing spacecraft would travel back to Earth with no astronauts aboard.

This is a developing story.