CAPE CANAVERAL, Fla. — After blasting off from the Kennedy Space Center here Saturday afternoon, and then whizzing around the Earth at speeds that eventually hit 17,500 mph, the SpaceX spacecraft carrying two NASA astronauts docked with the International Space Station Sunday morning, completing the first leg of a historic journey.

The mission was the first time NASA astronauts had launched from United States soil since the Space Shuttle was retired in 2011, and it marked the first time a private company had flown astronauts to orbit.

It was also a test flight designed to see how the spacecraft, which had never flown humans before, performed. So far, it seems the answer is very well, but the astronauts still need to return home safely after their tour on the station ends sometime in the coming months.

NASA astronauts Bob Behnken and Doug Hurley, the pair chosen for the mission because of their experience and expertise flying new vehicles, reported that the spacecraft was performing well.

“Dragon’s a slick vehicle,” Behnken said.

“We couldn’t be happier about the performance,” Hurley said.

With their trip to the space station completed, the pair can claim victory in an epic game of capture the flag, taking possession of the American flag that was brought to the station on the last shuttle flight, and was waiting to return to Earth by the first crew to reach the station from U.S. soil.

For NASA, the flight was the culmination of a journey that began years ago, when the Space Shuttle program ended with no way for the space agency to send people into space. In the nine years since, NASA paid Russia as much as $90 million a seat to fly its astronauts to the space station.

Ultimately, NASA decided to outsource the job of space launches to the private sector, awarding contracts to SpaceX and Boeing in 2014, worth a combined $6.8 billion. Initially, Boeing, the industry stalwart that had been NASA’s partner for generations, was considered the favorite. But its Starliner spacecraft encountered significant problems during a test mission without crews late last year and had to cut that flight short.

That left SpaceX, which also had encountered problems in developing its spacecraft, in the lead to be first to launch with astronauts on board.

Everything about this first crewed SpaceX mission appears to have been picture-perfect, from its on-time lieftoff at 3:22 p.m. Saturday to its rendezvous with the space station at 10:16 a.m. Eastern time Sunday. The astronauts floated into the space station at 1:22 p.m., 22 hours after they’d left Florida.

Hurley and Behnken, both of whom are married to fellow astronauts, seemed loose and relaxed during the journey, showing off the stuffed animals they had brought with them to show to their kids. Behnken did a weightless flip for the camera, and they carried on the tradition of naming their spacecraft, announcing they had dubbed their Dragon capsule “Endeavour” — the same name as the space shuttle they had both flown aboard.

On Sunday morning the crew continued another longstanding NASA tradition, choosing to wake up to music. The crew of Gemini 6 started the tradition in 1965, waking up to “Hello Dolly” by Jack Jones, according to a history complied by NASA historian Colin Fries.

The use of music as an alarm clock continued during the Apollo program “when astronauts returning from the Moon were serenaded by their colleagues in mission control with lyrics from popular songs that seemed appropriate to the occasion,” Fries wrote.

On the final flight of the Space Shuttle, the crew chose an eclectic mix from Elton John’s “Rocket Man,” R.E.M.’s “Man on the Moon,” and “Here Comes the Sun” by the Beatles.

Behnken and Hurley went in a different direction for their wake-up call Sunday. At 4:45 a.m., the controllers on the ground played Black Sabbath’s “Planet Caravan,” a slow, almost mystical tune that mixes guitar and bongos and is about “taking a spaceship out to the stars,” a band member once said.

During a live broadcast from the spacecraft, Hurley said the pair had been able to get some rest before the wake-up call.

“We ended up sleeping just like we are right now, in our chairs, which was actually a pretty comfortable night’s sleep,” he said.

By the time they woke up, the spacecraft was already bearing down on the space station, having performed a series of “burns” or engine thruster firings that raised its orbit and brought them closer to the orbiting laboratory.

The Dragon spacecraft flies autonomously, but the astronauts can take over the controls at any time, and they did so twice to check how the systems performed. During the broadcast from the capsule, Hurley noted that they were the first astronauts to control a spacecraft using a touchscreen.

“So we got that going for us,” he said.

Unlike the violent force of liftoff, docking is a delicate and carefully choreographed bit of orbital ballet, requiring patience and a finesse. Inside NASA’s mission control in Houston, and SpaceX’s headquarters outside of Los Angeles, controllers called through a series of maneuvers that seemed to go off without a hitch, one by one.

And then, at 10:16 a.m. Endeavour’s slow, smooth glide to the station ended with a kiss as the station flew over China and Mongolia.

“We have docking,” NASA’s Dan Huot said during a broadcast of the event.

It took a few hours for the crews to ensure that the pressure was equalized between the space station and the Endeavour spacecraft. But then the hatch was opened and after a few more minutes, the pair floated into the station. Behnken came first, Superman style, smile beaming, into the arms of fellow astronaut Chris Cassidy, who has been aboard the station since April.

Hurley came next. And the three astronauts and friends embraced, along with two Russian cosmonauts, Anatoly Ivanishin and Ivan Vagner.

Speaking during a welcome-aboard ceremony on the station, Hurley said “it’s great to get the United States back in the crewed launch business, and we’re just really glad to be on board this magnificent complex.”

NASA administrator Jim Bridenstine praised the pair, saying the agency is “so proud of everything you have done for our country, and in fact to inspire the world.”

The mission, Bridenstine said, foreshadows a sea change in the way NASA will do business in space. Instead of owning and operating the spacecraft itself, Bridenstine said, the future of the agency will lie with partnering with the growing commercial space sector, as it has with SpaceX.

“This was an amazing moment,” he said. “And it represents a transition in how we do spaceflight from the United States of America.”

The launch was initially scheduled for Wednesday, but was scrubbed because of weather. The delay meant Hurley and Behnken missed “Saturday housecleaning day,” Cassidy joked.

Not to worry, he said, promising to put his new crewmates to work: “We’ll catch up next weekend.”

Below are the updates from the docking of SpaceX’s capsule.