It wasn’t easy, but victory finally came in sight today.

The crew of Space Shuttle Atlantis had to overcome repeated challenges that years of exhaustive training on the ground couldn’t anticipate as they moved to complete their STS- 125 Mission overhauling the venerable but still spectacular Hubble Space Telescope.

A bolt that wouldn’t come loose without a lot of muscle, working in cramped quarters, the danger of sharp objects that could rupture an astronaut’s spacesuit in the lethal vacuum of the void at 300-plus-miles-altitude — all that and more confronted intrepid repair mechanics as they hung upside down, far above the blue marble of Earth, while traveling at 17,500 miles an hour.

That meant some exhausting work, including one of the longest spacewalks in history, at 8 hours 2 minutes yesterday.

Then, STS-125 mission specialists Mike Massimino and Mike Good completed the mission’s fourth spacewalk at 5:47 p.m. ET. They continued repairs and improvements to the Space Telescope Imaging Spectrograph (STIS) that will extend the Hubble’s life into the next decade.

Massimino and Good replaced a low-voltage power supply board, which contains a failed power converter. Due to this power supply failure, STIS has been in “safe mode” since August 2004.

A delay caused by a bolt removal issue forced the spacewalkers to cancel the installation of a new protective thermal insulation panel on Hubble.

That meant more workload for astronauts on the fifth and final mission spacewalk that began at 9:16 a.m. ET today.

First, however, the spacewalk today had to install new batteries, a bit more challenging than popping Duracells in your tape recorder, and also taking care of the fine guidance sensor task.

After that, it was on to the Bay 5 & 8 New Outer Blanket Layer installation tasks. For the baseline plan, a partial Bay 8 and a full Bay 5.

Completion of the Hubble makeover means that Atlantis will be able to undock from the telescope and prepare for reentry and landing later this week.

That will free Space Shuttle Endeavour from its current duty as a lifeguard for the Atlantis crew. Because Atlantis was going to the Hubble instead of to the International Space Station, that meant the station couldn’t be used as an emergency shelter in the event that Atlantis developed problems.

Since Atlantis launched a week ago from Launch Pad 39A at Kennedy Space Center, Fla., Endeavour has been sitting at the ready on Launch Pad 39B, set to fly to the rescue if needed.

When the all clear is given, Endeavour will be free to move to Pad 39A for a June 13 blastoff on the STS-127 Mission to the space station, where the shuttle crew will install the exposed facility on the Japanese Kibo laboratory module.

Even without the spacewalk today, the Atlantis crew has made gigantic improvements in the sky-high observatory, with the space telescope now in its best shape ever, in effect growing younger instead of older.

Hubble will continue to search the heavens, peering back not just in space, but in time as well to shortly after the Big Bang. The stunning photos that Hubble has sent back thus far of galaxies forming and colliding, cosmic wonderlands and worlds beyond the Milky Way are just a start, with the giant telescope set for what may be its best feats yet.

Hopefully, the Hubble will last well into the next decade, overlapping with its successor, the James Webb Space Telescope, or JWST.

While the JWST will be more powerful and have a larger mirror, seeing further into the past, it will be seeing primarily in the infrared spectrum, while the Hubble also has capabilities to see colors and ultraviolet as well.

The Hubble mission almost didn’t happen. At one point, officials had decided to forego the immense orbital repair job.

But some lawmakers worked tirelessly to reverse this decision, finding funds for the Hubble rescue, including Sens. Barbara A. Mikulski (D-Md.), Kay Bailey Hutchison (R-Texas), and Bill Nelson (D-Fla.).