SpaceX has visited the ISS before. NASA contracts the company to deliver supplies and science experiments on another version of the Dragon spacecraft, designed only for cargo. When those capsules approach, a powerful robotic arm on the station, controlled by an astronaut inside, reaches out to grab them and pull them toward a port.

But the crew-friendly Dragon was designed for a far more complicated rendezvous. The ISS has been preparing for the arrival of a commercially built spacecraft such as Dragon for years. A new docking port was delivered to the station by SpaceX itself in 2016. Astronauts installed new wiring and even rerouted ventilation in this part of the station so that power and air could flow to the spacecraft once it was docked. “It was a massive modification with an incredible amount of hardware,” Susan Freeman, an ISS engineer at NASA’s Johnson Space Center, tweeted on Sunday morning.

The capsule is equipped with software, sensors, and lasers to autonomously guide it toward and then stick itself to a port. Astronauts on the station can transmit important information to the spacecraft’s computers as it nears, but the final docking is up to the Dragon.

After reaching space, the Dragon spacecraft circled the Earth 18 times, firing engines to put itself on a trajectory toward the ISS. When the capsule neared the station, it moved closer and then backed away, practicing a retreat designed for emergencies.

Then, just before 6 a.m ET on Sunday, about 260 miles above the northern coast of New Zealand, the Dragon spacecraft stuck itself onto the ISS. For the first time in nearly eight years, an American-made spacecraft designed to carry humans had arrived at humankind’s home in space.

Cameras on the ISS captured the steady approach. At first, Dragon appeared as a white blob against the matte black of space. As the distance between the two spacecraft shrank, the Dragon came into full view, its white exterior gleaming in the sunlight. A cover at the nose of the spaceship had been flipped open not long after launch, revealing a ring of springs. As the Dragon made contact with a port on the ISS, the springs absorbed the impact. On the port, a dozen hooks latched the capsule into place.

Back on Earth, SpaceX headquarters erupted in cheers at the sight. Elon Musk, the company’s founder, no doubt exhaled. The mission has scrambled his nerves. “To be frank, I’m a little emotionally exhausted,” a serious-faced Musk told reporters on Saturday, an hour after the launch. “Because that was super stressful. But it worked—so far. We have to dock with station; we have to come back. But so far, it’s worked.”

Here’s the view from the ISS, at left, and from Dragon, at right:

The @SpaceX Crew Dragon is attached to the @Space_Station! It’s a first for a commercially built & operated spacecraft designed for crew! #LaunchAmerica pic.twitter.com/ddck58TVnP —NASA Commercial Crew (@Commercial_Crew) March 3, 2019

The ISS crew—Anne McClain of NASA, David Saint-Jacques of the Canadian Space Agency, and Oleg Kononenko of Russia’s Roscosmos—monitored the historic approach. After the Dragon docked, the crew members prepared to go inside. They conducted a series of checks, including an inspection of the airtight seal of the spacecraft and the air pressure inside a vestibule between them. Cameras inside the station showed the crew members floating around a square-shaped hatch, sliding their socked feet under wall railings to anchor themselves when they needed to use their arms.