SpaceX returned two NASA astronauts to Earth on Sunday after flying them to the International Space Station.
The mission, called Demo-2, flew the first crewed US spacecraft since the end of NASA's space shuttle program in 2011.
SpaceX's Crew Dragon spaceship is a product of NASA's Commercial Crew program, a partnership between the space agency and private companies.
Boeing is also building a spaceship as part of the program, but SpaceX's progressed faster.
Visit Business Insider's homepage for more stories.
SpaceX and NASA celebrated a major milestone on Sunday: the completion of the world's first crewed commercial spaceflight.
The company's Crew Dragon spaceship carried two NASA astronauts into orbit and docked to the space station two months ago, then returned on Sunday in a fiery plunge through Earth's atmosphere.
The mission, called Demo-2, was the last major test before NASA certifies the Crew Dragon to carry more people into space.
"This day heralds a new age of space exploration," Elon Musk, SpaceX's CEO, said during a NASA TV broadcast after the splashdown, adding, "I'm not very religious, but I prayed for this one."
Since NASA ended its space-shuttle program in 2011, the agency has relied exclusively on Russia to ferry its astronauts to and from orbit in Soyuz spacecraft. But those seats have gotten increasingly expensive, and the world's space agencies have had no alternative for launching and returning astronauts, even when technical glitches have arisen.
That's what spurred NASA to launch its Commercial Crew program, which was designed to facilitate the development of new American-made spacecraft.
The program put private firms in competition for billions of dollars' worth of government contracts. SpaceX and Boeing came out on top, and SpaceX's spaceship passed its tests and became ready for astronauts first.
Here's how NASA came to rely on the two companies to resurrect American spaceflight.SEE ALSO: 27 epic images show how SpaceX made history by flying NASA astronauts to and from the space station
DON'T MISS: Telescope video captured SpaceX's Crew Dragon spaceship attached to space station, 250 miles above Earth
NASA astronauts Doug Hurley and Bob Behnken are now the first people ever to fly in a commercial spacecraft.
Both men are spaceflight veterans and were deeply involved in SpaceX's efforts to design its Crew Dragon spaceship.
"This has been a quite an odyssey the last five, six, seven, eight years," Hurley said during a NASA live broadcast after the recent landing. "To be where we are now — the first crewed flight of Dragon — is just unbelievable."
Crew Dragon launched into space with the two astronauts inside atop a Falcon 9 rocket on May 30.
The mission, called Demo-2, was a demonstrate meant to show that the launch system and spaceship could safely transport people.
The next day, the capsule docked to the International Space Station, where it stayed for two months.
Aboard the space station, Behnken and Hurley conducted science experiments, routine maintenance, and a couple of spacewalks.
On Saturday, Behnken and Hurley climbed back into the capsule, which they'd named Endeavour, and undocked from the space station. The next day, they survived a fiery plunge back to Earth.
"It felt like we were inside of an animal," Behnken said in a briefing on Tuesday.
Parachutes slowed the fall, and Endeavour landed in the Gulf of Mexico at 2:48 p.m. ET on Sunday, off the coast of Pensacola, Florida.
Recovery teams helped the astronauts out of the capsule and gave them a medical check. The men were fine but found it difficult to stand; that's normal for ISS astronauts, since their bodies become accustomed to floating in space.
Prior to the Demo-2 mission, the last US rocket-and-spaceship system to carry astronauts to and from space was Atlantis, NASA's last space shuttle. It launched and landed in July 2011.
After 135 shuttle missions, NASA retired the program so it could direct funds towards long-term missions to the moon and, eventually, Mars.
Since then, NASA has relied on Russia's Soyuz system to ferry its astronauts to and from the International Space Station.
Soyuz has been the only human-rated spacecraft that can ferry people to and from the $150 billion, football-field-size orbiting laboratory.
Russia has nearly quadrupled its prices for NASA over a decade.
In 2008, a single round-trip flight for a NASA astronaut cost about $22 million; by 2018, that price had soared to about $81 million. As of late last year the price is about $85 million, according to CNN.
Additionally, two recent incidents raised concerns about the reliability and safety of Soyuz rockets.
In August 2018, a Soyuz began leaking air into space while attached to the space station. A small hole was found and investigated by cosmonauts. Russian authorities think the hole came from a manufacturing accident with a drill that was hastily covered up.
Then that October, a Soyuz rocket failed during launch. The space capsule, which was carrying one American and one Russian, automatically jettisoned away, and they walked away uninjured.
Despite these issues, the world's space agencies had no other options for getting their astronauts to and from the space station.
NASA's Commercial Crew Program has been developing alternative launch systems since 2010. The competition asked private companies to build new astronaut-ready spacecraft.
Once the program is complete, the agency will have doled out more than $8 billion in awards and contracts over about a decade.
"We don't want to purchase, own, and operate the hardware the way we used to. We want to be one customer of many customers in a very robust commercial marketplace in low-Earth orbit," Jim Bridenstine, NASA's administrator, said ahead of the Demo-2 landing.
From dozens of hopefuls, two contenders made it through the competition: SpaceX and Boeing.
Both of their spacecraft are designed to fly up to seven passengers to and from Earth's orbit.
SpaceX, which Musk founded in 2002, designed the Crew Dragon, a 14,000-pound spaceship that's made to be reusable.
The vehicle is SpaceX's biggest spaceflight achievement yet, but it's just the beginning of Musk's ambitions.
"This is hopefully the first step on a journey towards civilization on Mars, of life becoming multiplanetary, a base on the moon, and expanding beyond Earth," he told reporters after the Demo-2 launch.
Boeing, a century-old aerospace company, created the CST-100 Starliner, also a reusable capsule. It's made to land back on Earth using airbags, rather than splashing into the ocean.
Before Boeing launches astronauts on the the CST-100 Starliner, it will re-do an uncrewed flight test, since the first attempt unearthed critical issues.
In total, NASA selected nine astronauts to fly the Boeing and SpaceX spaceships on the demonstration missions and first official crewed missions.
The group includes former space-shuttle flyers, ex-military test pilots, rookies, and — critically — four astronauts (including Behnken and Hurley) who'd been testing and providing feedback on the commercial ships for years.
Before humans could fly in the new spacecraft, NASA required a robust series of test flights and demonstrations.
In one such test, the Crew Dragon flew to the space station without a crew in March 2019 — making it the first commercial vehicle to ever do so.
In that mission, called Demo-1, the spaceship launched from Cape Canaveral, Florida, then linked up to the International Space Station for five days. The only passengers were a crash-test dummy named Ripley, 400 pounds of cargo, and a fuzzy toy Earth.
Officials declared the test a complete success after the capsule splashed down in the Atlantic Ocean off the coast of Florida.
Bridenstine described the successful mission as "the dawn of a new era in American human spaceflight, and really in spaceflight for the entire world."
But later demos hit snags. SpaceX did not pass an April 2019 test that simulated a parachute failure.
The test was meant to examine what would happen if one parachute didn't deploy during a flight. SpaceX tried to simulate the situation, leaving only three parachutes to break the fall. Unfortunately, the other parachutes didn't properly deploy, either.
However, the Crew Dragon parachutes eventually received approval after undergoing 27 rounds of testing. They performed as planned when Behnken and Hurley landed.
William Gerstenmaier, NASA's associate administrator for human exploration and operations at the time, told Spaceflight Now that similar problems arose during Boeing's parachute tests.
That same month, a Crew Dragon capsule exploded during a test-firing on the ground. NASA and SpaceX both welcomed the surprise failure.
The mysterious explosion occurred as the capsule fired the large engines designed to help it escape a failing rocket.
"Ensuring that our systems meet rigorous safety standards and detecting anomalies like this prior to flight are the main reasons why we test," SpaceX said on the day of the failure.
Kathy Lueders, who managed the Commercial Crew Program and now leads NASA's Human Spaceflight Office, called the explosion "a huge gift for us" in terms of making the ship safer to fly.
Boeing launched its Starliner capsule toward the space station for the first time in December 2019.
Nobody was inside — just a mannequin named Rosie. There was also some food, Christmas presents, and other cargo for astronauts aboard the space station.
But the Starliner suffered a major glitch with a clock about 31 minutes after launch, causing it to veer off-course.
To save the uncrewed ship from total failure, Boeing skipped its docking with the space station — the main objective of the mission — and used the remaining propellant to stabilize the capsule's orbit and get it home.
On its early return to Earth, the capsule relied on impact-absorbing airbags to land safely in the desert.
A NASA safety panel revealed in February that the Starliner had also suffered a second software issue, which ground controllers patched in the middle of the test flight.
Boeing and NASA officials said the error could have caused a collision between two units of the spacecraft: the crew module and the service module.
The error prompted NASA to launch a larger investigation into Boeing's coding and culture.
NASA and Boeing have decided to re-do that uncrewed mission before the company launches its first astronauts.
The re-do is planned for October or November, according to The Washington Post, but officials have declined to offer a timeline for the Starliner's first astronaut flight.
Before they could carry people, both spaceships also had to prove they can jettison astronauts to safety in the unlikely event of a rocket-launch failure.
Such failures have happened to both the Space Shuttle and Soyuz systems, so having an escape plan is essential.
Boeing passed the ground test of the Starliner's abort system in November 2019.
The capsule rocketed nearly a mile into the air, then parachuted back to the ground. The entire flight lasted 1.5 minutes.
SpaceX demonstrated its escape system in January, by turning off one of its Falcon 9 rockets mid-flight while a Crew Dragon was perched on top.
The rocket was traveling at around twice the speed of sound when SpaceX shut it down. At that moment, the Crew Dragon detached, fired its own thrusters, and sped away from the soon-to-explode rocket.
The ship landed in the ocean under four giant parachutes.
"It went as well as one could possibly expect," Musk said of the escape-system demonstration.
Overall, the Commercial Crew program has run years past its deadline.
Boeing and SpaceX were supposed to have their systems certified by 2017, according to a report from the Government Accountability Office.
"Most of us are just way past ready for this to happen. It has taken a lot longer than anybody thought," Wayne Hale, a retired NASA space-shuttle program manager, told Business Insider in January.
Eventually, a round-trip seat on the Crew Dragon is expected to cost about $55 million. A seat on Starliner will cost about $90 million.
NASA has contracted six round-trip flights on Crew Dragon. Behnken's wife, Megan McArthur, will pilot the second one.
"What we did for Bob, I think we can do an even better job for Megan," SpaceX President Gwynne Shotwell said after the Demo-2 splashdown.
NASA also plans to open the space station to tourists for $35,000 per night.
Last year NASA announced it would allow two private astronauts per year to stay up to 30 days each on the space station.
Holly Secon contributed reporting.
Do you have a story or inside information to share about the spaceflight industry? Send Dave Mosher an email at [email protected]
or a Twitter direct message at @davemosher. More secure communication options are listed here.