With the shuttle's commander, Scott Altman, steering Atlantis, astronaut Megan McArthur reached out and grabbed the Hubble with the ship's robot arm. Then she gently lowered the telescope into the shuttle's cargo bay.
"Houston, Atlantis," Altman called to Mission Control. "Hubble has arrived on Atlantis with the arm."
It was a delicate operation, with the two giant spacecraft flying in formation at 17,200 miles per hour, more than 300 miles above the Earth's surface.
"I'm going to have to remind myself to breathe, and take it real slow," McArthur had said in an interview with ABC News before the flight.
Astronaut John Grunsfeld -- an astronomer by training -- took the microphone in the crew cabin a few minutes after the capture.
"I'm looking out the window here, and it's an unbelievably beautiful sight," he said.
Grunsfeld is on his fifth space flight, and his third to service the Hubble. He has said he felt strongly about the telescope -- even during the two year period when NASA thought this mission was too risky to fly, and Grunsfeld, then the agency's chief scientist, had to go along with the decision.
Atlantis' Risky Mission to Repair Hubble Space Telescope
Atlantis' astronauts, who have been training for this mission since 2006, plan a series of five space walks on successive days. The telescope is now locked in a specially-designed cradle at the rear of the shuttle's cargo bay, so that the astronauts can safely work on it.
They have to replace the telescope's batteries, gyroscopes, fine guidance system and other parts. They also carry new insulation to surround the Hubble's body so that it can better withstand the extreme temperatures of space.
The mission, designated STS 125 by NASA, is the last chance to save the Hubble telescope, whose batteries, cameras and gyroscopes are badly in need of replacement.
As the shuttle gradually closed in on the Hubble Tuesday, it underwent a tedious but necessary inspection to make sure it had not been damaged during liftoff. The shuttle Columbia was lost in 2003 because damage to one wing went unnoticed.
When orbiters travel to the International Space Station, they do a flip so that the space station crew can inspect the belly for damage. Since Hubble, obviously, doesn't have a crew to help them out, Atlantis' crew had to do all the work.
The Risks Facing Shuttle Atlantis
"We are going to inspect the vehicle to the same standards as a [space] station mission," Altman told ABC News before the launch. "We are doing that by using the boom out there with the sensors on it."
A boom attached to the end of the shuttle's robot arm was moved slowly over Atlantis' wings and underside Tuesday, with a camera and laser to look for potential damage.
Such work makes the flight a bit longer, Altman said.
This is the fifth and final space shuttle mission to the Hubble. It has been seven years since a shuttle last visited the telescope, and it is in need of a service call.
On this mission, astronauts will install a new wide-field camera and cosmic origins spectrograph, two instruments NASA said should significantly increase Hubble's potential.
Full-Scale Rescue Mission Ready If Needed
But the mission is also the riskiest one attempted by a shuttle since the Columbia accident in 2003.
Not only could debris hit the orbiter during launch, which was what happened to Columbia, orbiting debris could hit the shuttle while the astronauts fix Hubble.
Hubble orbits about 350 miles above Earth, in an area with a higher density of debris. Two satellites collided over Siberia earlier this year, which has increased the risk even more, as junk from that collision drifts lower.
As soon as Atlantis fixes Hubble, and releases it back into orbit, it will immediately maneuver to a lower altitude to reduce the chances of getting hit by space junk.
The most dramatic step NASA has taken to reduce risk is the preparation of a full-scale rescue mission.
In the event that Atlantis sustains damages the crew cannot repair, a second space shuttle, Endeavour, is standing by on another launch pad at the Kennedy Space Center to rescue crew members.
STS 400 can be ready in three days if a rescue is necessary.