The crews would fly on spacecraft developed not by NASA but by two corporations, SpaceX and Boeing, which are under contract to provide a taxi-like service to the International Space Station.

In a ceremony at the Johnson Space Center here, NASA Administrator Jim Bridenstine stood on a stage with a massive American flag, and introduced the crews, one-by-one, as they came on stage in distinct groups: one for SpaceX, the other Boeing.

On the first operational mission to the International Space Station, Sunita Williams and Josh Cassada would fly for Boeing. NASA astronauts Victor Glover and Michael Hopkins would fly Dragon’s first operational mission to the space station.

“It’s absolutely an opportunity of a lifetime,” said Mann, who was selected as an astronaut in 2013.

“The first flight is something you dream about as a test pilot,” said Hurley, who flew on the last shuttle mission.

In an interview, NASA Administrator Jim Bridenstine compared the crews to the Mercury astronauts, the seven test pilots featured in “The Right Stuff,” who flew at the dawn of the Space Age.

“The Mercury 7 and the crews that we just announced — that same spirit is there,” he said. “After all these years it hasn’t gone away.”

In 2014, Boeing and SpaceX were awarded a combined $6.8 billion in contracts from NASA to develop spacecraft capable of flying crews to the station, the orbiting laboratory.

Since then, they have been in a race to see which company would fly first in what’s become a sort of modern-day space race. The contrast was on display Friday. On one side, Boeing showed off its spacesuit, a handsome blue uniform, next to SpaceX’s sleek black-and-white suit.

Leading up to the ceremony at the Johnson Space Center here, Bridenstine said it was a historic moment for the agency: “We are going to launch American astronauts from American soil. That’s a big deal.”

Both Boeing and SpaceX have faced setbacks and delays — with the latest schedule slips being announced on Thursday. While both companies had recently said they would conduct their first test flights with astronauts on board by the end of this year, those flights are now scheduled for 2019.

Taking the stage Friday before a huge American flag, Gwynne Shotwell, the president of SpaceX, told the crews: “What a sacred honor this was to be part of this program and to fly you. Thank you. We take it very seriously. We won’t let you down.”

SpaceX said it would fly crews by April of next year. Boeing said only that it would fly NASA’s astronauts by the middle of next year. Bridenstine said he had faith in the revised timelines. “We’re so close,” he said. “Yes, I’m confident.”

Last week, Boeing confirmed that it had a problem with its launch-abort system, which is designed to ferry crews to safety in the event of an emergency. In a call with reporters this week, John Mulholland, Boeing’s program manager, said that several of the valves failed to fully close, resulting in a propellant leak.

Boeing has since identified the problem, he said, and is working to fix it. “The result is that we’ll have a better and safer spacecraft,” he said.

SpaceX did not give a reason for the delay of its first crewed test flight. But it had been working to resolve an issue with its second stage that caused one of its Falcon 9 rockets to explode while it was being fueled ahead of an engine test.

Since the shuttle was retired seven years ago, U.S. astronauts have had to fly on Russian rockets from a remote launch site in Kazakhstan.

In a recent report, the Government Accountability Office said that further delays in NASA’s “Commercial Crew” program could “disrupt access” to the space station, which would be an enormous embarrassment for NASA after investing about $100 billion to build and operate it.

The report warned that the companies’ schedules are “aggressive” and that they “have set ambitious — rather than realistic — dates, only to frequently delay them.”

In an interview, Sen. Ted Cruz (R-Texas) said the day marked “a return to where we should have been. For the last seven years, we’ve been forced to essentially hitchhike, catch a ride with the Russians on Russian rockets. And that was really unfortunate. That was not good for the American space program.”