Two astronauts floated into the shuttle Discovery's cargo bay today, opened up the Hubble Space Telescope and replaced six gyroscopes, restoring the $1.5 billion observatory's stability after a crippling failure last month.

Spacewalkers Steven Smith and astronomer-astronaut John Grunsfeld then turned their attention to installing six voltage regulators to keep Hubble's aging batteries from overheating during repeated charge-discharge cycles as the telescope sails into and out of Earth's shadow.

The spacewalk took longer than expected because of hard-to-loosen bolts and initially the astronauts installed only three battery regulators instead of the planned six. But they were given permission to install the remaining three.

But the top priority of the 96th shuttle mission was the installation of the new stabilizing gyroscopes to restore Hubble's ability to lock onto and track celestial targets during long-duration exposures.

The $1.5 billion Hubble, retrieved by the shuttle astronauts Tuesday night, went into scientific shutdown Nov. 13 when the fourth of its six on-board gyros failed, leaving it with one less than the bare minimum needed to carry out astronomical observations.

"The gyros are job one," said Hubble program manager John Campbell. "I can't wait to get those gyros up and working so we know we can go back on science and have a stable telescope to work with."

Much like the inner ear senses balance, the gyros sense the 25,000-pound telescope's motion and send that information to the observatory's flight computer. The computer then sends commands to counteract unwanted motion, which keeps Hubble locked onto its targets.

While two more spacewalks are planned Thursday and Friday, today's work effectively restored Hubble to operational status. If the astronauts had to depart Thursday for some reason, Hubble would be able to resume normal scientific observations.

But no such problems are anticipated, and a variety of other components will be installed Thursday and Friday, including a new flight computer, a replacement radio transmitter, a refurbished fine guidance sensor and additional thermal insulation.

If all goes well, Hubble will be released into open space Christmas Day. Science operations should resume in about two weeks, after the telescope's new components have had time to adjust to the space environment.

NASA originally planned to launch its third Hubble servicing mission next April. But last February, a third gyroscope failed, leaving the telescope one failure away from shutdown. As a result, NASA managers split the April mission into two flights and scheduled a quick-response mission in October to replace the gyros. As it turned out, technical problems and bad weather delayed Discovery's launch to Dec. 19, a month after the fourth gyro failed.

The astronauts trained to carry out four spacewalks. But Discovery's late launch, coupled with an end-of-year Y2K landing deadline, forced NASA to shorten the flight by two days, eliminating the fourth spacewalk.

The tasks planned for that spacewalk--primarily installation of wallpaper-like insulation blankets to improve the telescope's thermal control--will be deferred to the next Hubble servicing mission in 2001.

Today's spacewalk began at 1:54 p.m. EST when Smith and Grunsfeld, floating in Discovery's airlock, switched their spacesuits to internal power. A few moments later, they floated out into the shuttle's open cargo bay, breaking out tools and setting up repair stands.

A few moments later, Grunsfeldmarveled aloud at the view: "Wow . . . ."

"Welcome to the spacewalking world, John," replied veteran spacewalker Smith.

With Grunsfeld anchored on the end of the shuttle's 50-foot-long robot arm, Smith used a power wrench to open clamshell-like access doors at the base of the four-story-tall telescope.

Smith floated inside and disconnected the electrical cables leading to the first gyroscope package, known as a rate sensor unit, or RSU. Each 24-pound RSU, about the size of a toaster oven, houses two gyroscopes.

While Smith held the first RSU in place, Grunsfeld reached in with a power tool and unbolted the old unit, which Smith removed. Smith held a replacement RSU in place while Grunsfeld bolted it down.

Other than momentary trouble with a few balky bolts, the astronauts had no major problems.

Ground controllers at the Goddard Space Flight Center in Greenbelt immediately sent commands to verify the RSU was properly connected. It was, giving engineers "90 percent confidence everything is okay," Campbell said.

CAPTION: Astronauts John Grunsfeld and Steven Smith work on Hubble Space Telescope in shuttle's cargo bay.