SpaceX's Crew Dragon spacecraft, built to carry U.S. astronauts to orbit starting later this year, caught up with the International Space Station early Sunday and moved in for a picture-perfect docking, a major milestone in NASA's drive to resume launching U.S. astronauts from U.S. soil for the first time since the shuttle was retired in 2011.

"Today, we welcome a brand new spacecraft to space station, a great new addition to the quiver of tools we have ... to further space exploration," said Canadian astronaut David Saint-Jacques from the station. "This is the first day of a new era for the next generation of space explorers."

The Crew Dragon, carrying about 400 pounds of supplies and an instrumented astronaut test dummy nicknamed Ripley, approached the station from behind and below, using a carefully timed series of thruster firings to move up to a point about 500 feet directly in front of the lab complex.

Get Breaking News Delivered to Your Inbox

With both ships moving through space at nearly five miles per second, the new crew capsule halted and briefly reversed course to demonstrate its ability to stop an approach and retreat on command if problems develop. Then it moved in to a point just 65 feet from the station's forward port.

A crystal clear view of the SpaceX Crew Dragon spacecraft, its nose cone hinged open, on final approach to the International Space Station. NASA

Spectacular video from the station showed the sleek capsule, its nose cone hinged open to reveal its docking mechanism, moving in slowly against the deep black of space. The view from cameras inside the Crew Dragon showed the station's docking port at the center of the display, the same view approaching astronauts will have later this year.

After holding position to await more favorable lighting, the spacecraft resumed its approach and eased in for docking, engaging the station's International Docking Adapter at 5:51 a.m. EST (GMT-5) as the two vehicles passed 257 miles above the Pacific Ocean north of New Zealand.

"Soft capture confirmed," mission control reported as SpaceX employees watching the rendezvous unfold at company headquarters in Hawthorne, California, burst into cheers and applause.

The first @Commercial_Crew mission arrived at the space station today when the @SpaceX #CrewDragon completed soft capture on the Harmony module at 5:51am ET. #LaunchAmerica https://t.co/Bgcgac0O50 pic.twitter.com/KfNFpHxpGx — Intl. Space Station (@Space_Station) March 3, 2019

The linkup came 27 hours after the Crew Dragon's launch early Saturday from the Kennedy Space Center atop a SpaceX Falcon 9 rocket.

"Congratulations to all of the teams on a successful docking," astronaut Anne McClain radioed from the space station a few minutes later.

Astronaut Robert Behnken and Douglas Hurley plan to blast off aboard a Crew Dragon for the program's first piloted test flight in July. They watched the "Demo 1" launch from the Kennedy Space Center early Saturday and flew to California to monitor the docking from SpaceX mission control in Hawthorne.

"Doug and I will do it for the first time together, primarily in a monitoring role," Behnken said. "We may push a button or two to demonstrate that we have the capability to intervene if we need to, but the vehicle is pretty much going to do the work autonomously, just like it did today."

About two hours after docking, Saint-Jacques and station commander Oleg Kononenko, wearing protective masks, opened the Crew Dragon's forward hatch and floated inside to collect air samples, standard procedure when new vehicles arrive for the first time. There air was clear of contaminants and the masks were soon doffed.

NASA astronaut Anne McClain shows off the interior of the SpaceX Crew Dragon capsule, including a floating "Earth doll" used to indicate weightlessness and Ripley, an instrumented dummy astronaut packed with sensors to measure the environment real astronauts will experience during launch and entry. NASA

"We're standing in Node 2 at the very forward end of space station where space shuttles used to dock, and now we have a brand new vehicle that's come this morning, flawless operations, the result of years of work, thousands of people around the world on many teams. It was a beautiful thing to see," Saint-Jacques said during a brief ceremony.

A few moments later, McClain floated into the SpaceX capsule and showed off the spacesuited Ripley, packed with sensors to measure the forces real astronauts will experience during launch and entry, and a stuffed Earth doll placed aboard before takeoff to indicate the absence of gravity.

"On behalf of Ripley, little Earth, myself and our crew, welcome to the Crew Dragon," she said. "Congratulations to all of the teams who made yesterday's launch and today's docking a success. These amazing feats show us not how easy our mission is, but how capable we are. Welcome to the new era in space flight."

SpaceX and Boeing are both building crew ferry ships in an $8 billion push by NASA to restore America's ability to launch U.S. and partner astronauts to space in the wake of the space shuttle's retirement in 2011.

Since then, NASA and partner astronauts from the European Space Agency, Canada and Japan have been forced to hitch rides to the station aboard Russian Soyuz spacecraft at a current cost of more than $80 million a seat.

If the current unpiloted demonstration flight goes well and no major problems develop with other upcoming tests, SpaceX hopes to launch Behnken and Hurley in July for what will be the first piloted U.S. space mission in nearly eight years.

Boeing's CST-100 Starliner capsule is tentatively scheduled for an unpiloted test flight at the end of April, followed by the company's first piloted launch atop an Atlas 5 rocket in August or September.

Chris Ferguson, commander of the final shuttle flight and now a Boeing executive, will join two other NASA astronauts aboard the Starliner for the company's first piloted launch this fall.

He congratulated SpaceX in a tweet Sunday morning, noting the Crew Dragon was the first spacecraft to visit the station's forward port since he departed aboard the shuttle Atlantis.

This view from a camera inside the Crew Dragon capsule shows what astronauts will see during approach to the space station. NASA

Both SpaceX and Boeing face major technical hurdles with a variety of issues that must be resolved before piloted flights will be approved by NASA.

The successful launch and docking in the Crew Dragon's initial test flight are major milestones, but the spacecraft still face the challenge of its first hypersonic atmospheric entry and splashdown Friday off Florida's east coast.

While optimistic, NASA is hedging its bets and plans to buy two more Soyuz seats, one for use this fall and the other next spring, to ensure U.S. astronauts will be aboard the space station through next year even if the commercial crew program runs into major problems and delays.

For its part, Roscosmos, the Russian federal space agency, congratulated NASA on the successful Crew Dragon docking.

"Roscosmos congratulates NASA on the successful docking of the new ship and emphasizes that flight safety must be immaculate," the space agency tweeted according to Google Translate. "The state corporation welcomes the development of relations in the field of space exploration and expresses confidence that cooperation will develop."