CAPE CANAVERAL - Spacewalking astronauts finished work on the inside of the Hubble Space Telescope on Monday and shut the doors to the treasured observatory, which will never be touched by human hands again.

The only repair work left was to attach protective covers to the outside.

NASA said the telescope will be better than ever thanks to the astronauts' efforts over the past five days and should provide more dazzling views of the universe for another five to 10 years.

During this last visit to Hubble, the shuttle Atlantis astronauts outfitted Hubble with two state-of-the-art science instruments, and all new batteries and gyroscopes. The US$220 million worth of new instruments should allow the telescope to peer even deeper into the cosmos, as far back as 13 billion years.

It was the fifth and final spacewalk for the Atlantis crew, and the fifth and final visit by astronauts, ever, to Hubble.

"This is a real great day," Mission Control told the astronauts, "a great way to finish this out."

Keen on leaving the 19-year-old observatory in the best possible shape for gazing upon the universe, chief mechanic John Grunsfeld and Andrew Feustel gave the telescope another fresh set of batteries Monday and a new sensor for fine pointing. That left plenty of time to install steel foil sheets to protect against radiation and the extreme temperature changes of space.

"I'm keeping my fingers crossed still," commander Scott Altman said midway through Monday's spacewalk.

Only one of the first four spacewalks went smoothly. On Sunday, a stuck bolt almost prevented another team of astronauts from fixing a burned-out science instrument. Brute force saved the day, but so much time was lost that no protective sheets could be installed.

Grunsfeld and Feustel -- who headed outside nearly an hour early -- hoped to pick up the extra work.

The shuttle astronauts will set Hubble free Tuesday.

During the mission, the four spacewalkers, two per team, managed to fix two science instruments that had broken down years ago and were never meant to be tinkered with in orbit, and replaced a faltering science data-handling device. They also installed a docking device so a robotic craft can latch on and steer the telescope into the Pacific sometime in the early 2020s.

All told, this visit to Hubble cost more than $1 billion.

Hubble senior project scientist David Leckrone was hoping the spacewalkers would give the telescope a goodbye hug on behalf of the "thousands and thousands of Hubble huggers all over the world."

Grunsfeld, an astrophysicist who has spent more time working on the orbiting Hubble than anyone, was expected to do the honors. He's visited Hubble twice before, and plans to use the telescope once he's back on Earth to study the moon.

NASA hopes to crank Hubble back up by summer's end, following extensive testing of its new parts.

Already, though, scientists have gotten more than they could have hoped out of Hubble, which was launched in 1990 with a projected working lifetime of 15 years. Once its blurred vision was corrected in 1993 and NASA's reputation was restored, the telescope began churning out breathtaking images: among other things, stars in the throes of birth and death.

Back at the launch site, meanwhile, NASA maintained its vigil in case another shuttle needed to rush to the rescue. Atlantis escaped serious launch damage a week ago, but was susceptible to all the space junk in Hubble's 563-kilometre-high orbit. The astronauts will perform one last survey of their ship after releasing the telescope.

NASA took unprecedented steps to have Endeavour on the pad as a rescue ship, because the Atlantis astronauts have nowhere to seek shelter if they cannot return to Earth because of shuttle damage. The space station is in another, unreachable orbit.

The increased risk prompted NASA to cancel the mission five years ago in the wake of the Columbia accident. It was reinstated two years later.

With NASA's three remaining space shuttles set for retirement next year, there will no way for astronauts to return to Hubble. The new spacecraft under development will be much smaller and less of a workhorse than the shuttle, and lack a big robot arm for grabbing the telescope. Hubble's replacement, the James Webb Space Telescope, will be launched in 2014 by an unmanned rocket and placed in an orbit inaccessible to astronauts.