May 16, 2009: Astronauts Andrew Feustel, right, and John Grunsfeld work on the Hubble Space Telescope during a spacewalk. (AP/NASA)

Spacewalking astronauts gave the Hubble Space Telescope a more commanding view of the cosmos by installing a new high-tech instrument Saturday, then pulled off their toughest job yet: fixing a broken camera.

It was the third spacewalk in as many days for the shuttle Atlantis crew, and it was the most intricate ever performed because of the unprecedented camera repairs. Astronauts had never before tried to take apart a science instrument at the 19-year-old observatory.

Hubble's chief mechanic, John Grunsfeld, deftly opened up the burned-out camera and plucked out all four electronic cards that needed to be replaced.

"Somehow I don't think brain surgeons go 'woo-hoo' when they pull something out," one of the astronauts observed from inside Atlantis.

To everyone's surprise, the new cards and power supply pack went in just as smoothly, seeming to take almost no time at all. In fact, the astronauts found themselves running ahead of schedule for a change, and their spacewalk lasted the allotted 6 1/2 hours. The first two spacewalks ended up running long because of unexpected difficulties encountered with Hubble, last visited seven years ago.

The astronauts cheered when Mission Control radioed up the news that the freshly repaired camera had passed the first round of testing.

The high-stakes job unfolded 350 miles above Earth. Orbiting so high put Atlantis and its astronauts at an increased risk of being hit by space junk. NASA had another shuttle on launch standby in case a rescue was needed.

Earlier, Grunsfeld and his spacewalking partner, Andrew Feustel, accomplished their first task, hooking up the $88 million Cosmic Origins Spectrograph.

They made room for the new supersensitive spectrograph — designed to detect faint light from faraway quasars — by removing the corrective lenses that restored Hubble's vision in 1993.

"This is really pretty historic," Grunsfeld said as he and Feustel hoisted out the phone booth-size box containing Hubble's old contacts.

Hubble was launched in 1990 with a flawed mirror that left it nearsighted. But the newer science instruments have corrective lenses built in, making the 1993 contacts unnecessary. The latest addition, the cosmic spectrograph, is expected to provide greater insight into how planets, stars and galaxies formed.

The switch — taking out the 7-foot-long box containing the corrective lenses and putting in the spectrograph — proved to be straightforward. It's exactly the kind of replacement work astronauts performed on four previous repair missions.

Fixing the 7-year-old camera was far more complicated. The instrument — called the Advanced Camera for Surveys — suffered an electrical short and stopped working two years ago. Ground controllers had been able to eke out a minimal amount of science but hoped to get it back into full operation.

Before it broke, the surveys camera provided astronomers with the deepest view of the universe in visible light, going back in time 13 billion years.

NASA considered this repair job — and one set for Sunday on another failed science instrument — to be the most delicate and difficult ever attempted in orbit. Neither instrument was designed to be handled by astronauts wearing thick, stiff gloves.

Grunsfeld unscrewed 32 fasteners to get to the camera's electronic guts, all the while working around a corner that prevented him from seeing everything he was doing. He used long tools designed just for the job.

"This activity is dedicated to studying the behavior of tiny screws in space," he joked.

NASA hopes to keep Hubble working for another five to 10 years with all the improvements. No one will be back to Hubble, so everyone at NASA, the seven astronauts included, wants to squeeze in as much repair work as possible. Already, they have given Hubble two top-of-the-line science instruments, fresh batteries and gyroscopes, and a new science data unit to replace one that broke last fall.

If all goes well, the fifth and final spacewalk is set for Monday and the telescope will be released from Atlantis on Tuesday.