Astronauts from the Columbia space shuttle had to shut down the telescope's power to fit the new component.
And they had to work quickly so that Hubble's power could be turned back on before it was damaged by the extreme cold of space.
Then the message came through from mission control: "Hubble has a heartbeat!"
The spacewalk had been delayed for two hours because of a water leak.
Half an hour before the astronauts were due to exit the shuttle, they noticed liquid coolant escaping from John Grunsfeld's spacesuit.
But the astronaut changed into another suit and the spacewalk went ahead.