Elon Musk's rocket company, SpaceX, on Saturday launched for the first time a commercial spaceship designed to fly NASA astronauts.

The ship, called Crew Dragon, pulled off another first on Sunday morning: its first docking with the International Space Station.

No people flew inside Crew Dragon (just cargo and a dummy), but crew members already at the space station opened the hatch and greeted the spacecraft.

"Welcome to the new era in spaceflight," an astronaut said from inside SpaceX's ship.

Crew Dragon will try to leave the space station and return to Earth on Friday on a mission called Demo-1.

SpaceX has become the first company to design, build, launch, and now dock a commercial spaceship made to fly people to the International Space Station.

Elon Musk's rocket company launched the seven-seat vehicle, called Crew Dragon, on Saturday at 2:49 a.m. ET. By early Sunday, the 14,000-pound space capsule had caught up to the football-field-size laboratory that orbits Earth.

After a series of safety checks, SpaceX began nudging Crew Dragon toward the front end of the space station. At 5:51 a.m. ET, it made soft contact with a docking node, engaged six arms, and latched on. About 11 minutes later, the spaceship tightly screwed itself to Node 2 of the space station.

Nobody was on board to open Crew Dragon's hatch — only 400 pounds of cargo and a crash-test dummy named Ripley. However, NASA said SpaceX's demonstration, or Demo-1 mission, is "a critical first step" in restoring US-crewed access to space, since the goal is to prove the new spaceship is safe to fly its astronauts.

"A new generation of space flight starts now with the arrival of @SpaceX's Crew Dragon to the @Space_Station," Jim Bridenstine, the NASA administrator, tweeted on Sunday. "Congratulations to all for this historic achievement getting us closer to flying American Astronauts on American rockets."

Read more: NASA picked these 9 astronauts to fly SpaceX and Boeing's spaceships for the first time

The astronauts of Expedition 58 at the ISS speak during a welcome ceremony for SpaceX's Crew Dragon capsule, the first commercial spaceship to enter orbit, on Sunday. NASA TV

NASA's space shuttle Atlantis was the last American human-rated ship to touch the space station, and that was in July 2011. (NASA retired the space shuttle program after that flight.)

On Sunday, Crew Dragon docked with Node 2, where NASA's 100-ton space shuttle orbiters often used to dock.

The symbolism was not lost on the space station's three-person Expedition 58 crew, who opened the hatch, floated inside Crew Dragon at 8:07 a.m., and held a greeting ceremony for Crew Dragon live on NASA TV.

"It was a beautiful thing to see," said David Saint-Jacques, a Canadian astronaut and station crew member. "Today we welcome a brand-new spacecraft to the space station and a great new addition to the quiver of tools we have for humans to further space exploration. This is a good day, a first day of a new era for the next generation of space explorers."

'Welcome to the new era in spaceflight'

Anne McClain, an astronaut, plays with a plush Earth toy inside SpaceX's Crew Dragon capsule. The vehicle docked to the ISS on Sunday, marking the first arrival of a human-rated commercial spaceship at the football-field-size laboratory. NASA TV

During the brief greeting ceremony, Oleg Kononenko, a Russian crew member and the Expedition 58 commander, spoke first.

"On behalf of my crew, I would like to congratulate the United States of America and the NASA team for this very significant event: the launch and docking of the SpaceX Crew Dragon spaceship," Kononenko said. "It's a historic step ... on our way of human beings [moving] beyond low-Earth orbit to the moon, and Mars, and the future."

Saint-Jacques spoke next, marveling at the thousands of people, years of work, and close collaboration between SpaceX and NASA that it took to pull off the docking of a commercial spaceship.

Last was Anne McClain, a NASA astronaut who's part of the space station's crew. She had the most to say about Crew Dragon's successful arrival at her orbiting home in the sky.

"Our sincere congrats to all earthlings who have enabled the opening of this next chapter in space exploration," McClain said. "And congratulations to all nations, private space firms, and individuals who wake up every day driven by the magic of exploration. This day belongs to all of us."

Read more: Humanity's coolest achievements in spaceflight since Apollo 8, from walking on the moon to touching interstellar space

She remarked on the international makeup of the space station and the effort that went into its creation 250 miles above Earth, adding that Crew Dragon is now part of it.

"Spaceflight gives us a chance to reflect on the context of our existence. We are reminded that we are human before any of our differences, before all of the lines are drawn that divide us," she said. "We are reminded that we're at our best when we are a part of something bigger than ourselves."

She continued: "These events remind us that we are more alike than different, that we can be united by a cause that is not based on fear, threat, or a common enemy, but rather on a bold endeavor — an insatiable curiosity to go beyond what is known and to do what has never been done. We humans were built for exploration, and we were built to do it together."

McClain and her colleagues then floated into the Crew Dragon to show it off to the world.

Inside the spaceship, McClain grabbed onto a plush Earth toy that SpaceX had strapped into a seat before launch. The toy, which Musk has called a "super high tech zero-g indicator," has been floating around the cabin on the end of a string since Crew Dragon entered orbit.

"On behalf of Ripley, little Earth, myself, and our crew, welcome to the Crew Dragon," she said. "These amazing feats show us not how easy our mission is, but how capable we are of doing hard things. Welcome to the new era in spaceflight."

She then spun the Earth toy with a gentle nudge.

A difficult road remains for Crew Dragon's maiden flight

Crew Dragon's mission is not over with docking and opening the hatch. It has to pull off a series of other feats, including a textbook landing, before NASA will allow astronauts on board.

Launch and docking are what Musk described on Saturday as "some of the riskiest items" in the Demo-1 mission. But undocking, deorbit, and a splashdown — landing in the water — are up next.

The space station crew is supposed to close the Crew Dragon's hatch sometime on Thursday, and the ship is scheduled to depart at 2 a.m. ET.

Read more: Here's what SpaceX's sleek new Crew Dragon spaceship must do to prove it's safe to fly people

Crew Dragon is then scheduled to land in the Atlantic Ocean near Kennedy Space Center on Friday around 7:30 a.m. ET. (You can watch live coverage of each major milestone here.)

If SpaceX can pull off Demo-1 with flying colors, the mission could be a major turning point for the company.

SpaceX founder Elon Musk, left, with the NASA astronauts Victor Glover, Doug Hurley, Bob Behnken, NASA Administrator Jim Bridenstine, and Mike Hopkins during a tour of Launch Complex 39A at the Kennedy Space Center in Florida before the launch of the Demo-1 mission early Saturday. Joel Kowsky/NASA

"The whole goal of SpaceX was crewed spaceflight and improving space exploration technologies — that's actually the full name of the company: Space Exploration Technologies," Musk said during a press briefing on Saturday after launch.

"It's been 17 years — we still haven't launched anyone yet — but hopefully we will later this year," he added. "That would definitely be the culmination of a long dream for me and a lot of other people at SpaceX."

Data gathered by Demo-1 will be used to tweak and finalize a new Crew Dragon to fly astronauts on an experimental mission called Demo-2.

SpaceX and NASA may rocket that first crewed mission toward the space station as soon as July, and the veteran astronauts Bob Behnken and Doug Hurley will be on board.

"It's an incredibly sleek-looking vehicle," Hurley said during an impromptu press briefing on Friday at Kennedy Space Center, adding that it's "a lot more intuitive" than the space shuttle. He said that instead of about 2,000 knobs, buttons, dials, switches, and other controls like a shuttle orbiter, Crew Dragon had about 30.

"We've been following the process for a few years at this point," Behnken said after launch on Sunday. "So seeing a success like this definitely gives us a lot of confidence in the future."

Correction: A previous version of this story incorrectly said space shuttle Endeavour was the last to dock to the space station; it was space shuttle Atlantis.