Space Shuttle Discovery launched into orbit 30 years ago today with the Hubble Space Telescope in its payload bay.

Charlie Bolden, who served as pilot for the STS-31 shuttle mission, remembers the five-day spaceflight like it was yesterday. "What stands out most vividly in my mind is all the things that didn't go right," Bolden recalled in an interview.

It's true. Although astronomers would not discover that the Hubble Space Telescope had a serious problem with its mirror until a few weeks after Discovery landed, the deployment mission was not without difficulties itself. The crew came within minutes of embarking on an emergency spacewalk and even had contingency plans to bring Hubble back to Earth if needed.

The mission was novel from the beginning, with a planned orbit at 612km above the planet's surface requiring the vehicle to fly higher than any shuttle mission to date. Telescope deployment came a day after the shuttle reached orbit and involved a complicated sequence of events. After disconnecting the telescope from the shuttle's power supply, astronauts would use a robotic arm to move the instrument from the shuttle's payload bay, open its solar arrays, and finally release the telescope.

"From the time we disconnected Hubble from the shuttle's power, we had two clocks running," explained Bill Reeves, who was the mission's flight director and supervised operations from Johnson Space Center. "The telescope was on battery power from that moment, and there was a limited supply. And with the telescope attached to the arm, the shuttle had to be on free drift, as thruster firings might damage the instrument."

When ground controllers commanded the telescope to begin unfurling its two solar arrays, one of the arrays did not do so properly. Minutes turned into hours as engineers on the ground troubleshot the problem. Reeves had a contingency plan for this, of course. It entailed sending astronauts Bruce McCandless and Kathryn Sullivan outside the shuttle to manually deploy the arrays.

A few hours into the ordeal, with the Hubble batteries draining and the shuttle beginning to rotate without attitude control, Reeves directed McCandless and Sullivan to suit up and enter the airlock. They depressurized down from 14.7psi down to 5psi and conducted their spacesuit leak checks—the final step before fully depressurizing the airlock, opening the hatch, and going out into space.

As Reeves contemplated whether to give this egress order, engineers said they thought they had identified a problem with the software that monitored tension in the solar array. Making a small change, they proposed, would fix the problem. This worked, and the second solar array unfurled beside its companion. However, because the telescope still had to be deployed and the robotic arm stowed, Reeves kept McCandless and Sullivan in the airlock, without even a window to watch as the Hubble telescope floated away.

"They were the only two people on the planet that didn't get to see the Hubble deploy," Reeves said. To this day, he added, Sullivan still asks in jest if he did that on purpose.

After Hubble deployed, the shuttle retreated half an orbit away, in case some immediate problem arose that the crew needed to fix. (There wasn't, as the scientific commissioning of the instrument would not happen for a couple of weeks). If Hubble's problems were bad enough, the STS-31 crew had plans to bring the telescope back to Earth in Discovery's payload bay. The shuttle was slated to land on the longer Edwards Air Force Base runway in California, instead of Florida, because of the possibility of coming back heavier, with a damaged Hubble in tow.

Because there were no apparent problems while they remained on orbit, the astronauts were given the all-clear to return five days after launching. Upon the shuttle touching down in California, Reeves recalls telling his flight controllers, "You people have no idea what you've just done." The Hubble Space Telescope, he said, would change the way humans looked at the stars.

For a while, Bolden recalls being on top of the world after landing. Like everyone else, the astronauts eagerly awaited the first image from the telescope, a shot of a distant star named HD96755 captured on May 20, 1990. Their elation was crushed when the first picture turned out to be blurry and only marginally better than ground-based telescopes. Soon, astronomers realized the telescope had a warped mirror.

"The morale just went rock bottom," said Bolden. "NASA became the brunt of jokes around the world. We were a big hit with all the nighttime talk shows for about three years."

But then a funny thing happened. NASA activated its Apollo 13 muscle memory and, over the course of the next three years, planned a meticulous servicing mission to correct the mirror, upgrade its instruments, and bring a new and more powerful set of solar panels. In December 1993, Space Shuttle Endeavour flew an 11-day servicing mission that included five spacewalks. Story Musgrave, who had worked on Hubble's development since the early 1970s, served as lead spacewalker.

"The machine had a very bad start," he said. "Putting the wrong mirror in the telescope was criminal negligence. I forgive mistakes, but that was much worse than a mistake. That's not a good story."

What followed, however, is a good story. Over the last 27 years, and four additional servicing missions, NASA and its astronauts have upgraded the instrument beyond the dreams of its original planners. Hubble has emerged as arguably the most important scientific instrument of all time, both enlightening astronomers about the nature of the Universe as well as transcending science into popular culture.

"I was not ready for the power of the observations," Musgrave said. "Compared to some of the big telescopes on Earth, Hubble is such a tiny telescope. But it's got a clear view. People love the images, not just for the science but for their beauty. It says something about who we are."