NASA has decided to move ahead with an ambitious mission to service the Hubble Space Telescope using a robotic repairman to change batteries and gyroscopes, add new instruments, and maybe fix a malfunctioning spectrograph, agency officials said yesterday.

Al Diaz, associate administrator of NASA's Science Mission Directorate, said NASA Administrator Sean O'Keefe traveled to Hubble's operational headquarters at the Goddard Space Flight Center in Greenbelt late Monday and instructed the engineers there to begin serious work to put the robotic mission into space in 2007.

The decision marked a sharp turnabout for O'Keefe and NASA, which has suffered withering criticism since a January announcement that it would no longer service Hubble at all and would develop a robot whose only purpose would be to steer the telescope out of orbit and safely into a watery grave.

Diaz described the next nine months as "a design and testing phase" in which engineers will work out details of the mission to prove that a robotic servicing mission can be done. Then will come a "critical design review," in which the agency will decide whether to commit the money to finish the job. A successful mission would extend the life of the 15-year-old telescope by at least five years, Diaz said.

Since spring, Goddard engineers have expressed growing excitement about the prospect of a robotic mission, in part because of the spectacular test performance of the Canadian Space Agency's Special Purpose Dexterous Manipulator, or "Dextre." The unit has two 10-foot arms that pivot around a central "torso" and would do the job of replacing aging Hubble components.

Dextre was designed to fly to the international space station in 2005 and is fully hardened for space. Diaz said NASA intends to do a "sole-source" procurement focused on Dextre, but he acknowledged that there are other contenders, including the University of Maryland's "Ranger" and NASA's own "Robonaut."

"I think it's great," said Steven V.W. Beckwith, director of Baltimore's Space Telescope Science Institute, which manages Hubble's scientific work. "The amount of money that's being discussed is serious, and the real challenge will be to see if the Hubble team can overcome the technological challenges."

The robot, attached to an unmanned spacecraft that would dock with the telescope, will be expected to change the batteries that provide Hubble's electric power and the gyros that keep it aligned in space. It will also add two new instruments and may even try to repair the recently damaged Space Telescope Imaging Spectrograph, used to examine black holes and discern the chemical composition of planets and stars.

NASA officials said O'Keefe told Goddard's Hubble team that the mission would cost between $1 billion and $1.6 billion, which could make it considerably more expensive than the $800 million to $1 billion spent on space shuttle trips to the telescope, the method used to service Hubble in the past.

But Diaz, speaking to reporters in a telephone news conference, said planners have seen "a wide range of estimates" and are far from sure what the eventual price might be. "We expect to have a dialogue with Congress about the budget," he said.

The agency is likely to find a sympathetic ear. Congress has shown bipartisan and consistent opposition toward plans to shut down Hubble, and at one point it warned O'Keefe not to withdraw funds from the telescope program pending a final decision on its fate.

Hubble, in orbit 360 miles above Earth, is one of the most successful NASA projects ever undertaken. With periodic space shuttle visits for overhauls and instrument updates, the telescope has produced generations of spectacular images from the far reaches of the cosmos.

Concern over Hubble's future surged in January, when O'Keefe announced that he was canceling the fourth shuttle servicing mission to the telescope, citing safety concerns after last year's Columbia disaster.

Without servicing, NASA planners have said that Hubble's batteries will wear out by the end of 2007 and that the telescope will shut down within hours. From the beginning, NASA has declared 2007 as the deadline for any repair mission.

Though O'Keefe early this year invited ideas for a robotic servicing mission, the agency's attention initially focused on the need to develop an autonomous vehicle that could dock with Hubble and steer it into the sea, so that remnants of the telescope would not fall into populated areas.

Diaz said yesterday that "automated rendezvous and docking" is "something we want to have anyway" for future exploration missions. Russia currently has the only spacecraft with such a capability, but European countries and Japan have similar vehicles under development.

O'Keefe remained adamant about the prohibitive costs in money and time of developing the safety equipment for a shuttle mission, but the National Academy of Sciences in June issued a report urging the agency not to abandon that option altogether. "We are not doing anything to preclude that alternative," Diaz said.

Diaz said engineers so far have found no task that is beyond the ability of a robot, but he cautioned that they have not had time yet to assess the risks of failure. "You must take into account the first principle," he said. " 'Do no harm.' "

Beckwith said the job would be very difficult for a robot but would probably be doable. "Being able to open and shut the large bay doors is the benchmark, because astronauts have had trouble doing that," Beckwith said. "If you can't shut the doors, it would seriously cripple the observatory."

Fixing the imaging spectrograph would also be difficult, he said, because the malfunctioning part was not designed to be replaced. "For a robot to do all of these things would be a stretch," he said. "But the people looking at this are very, very good."

NASA Administrator Sean O'Keefe has instructed engineers to begin work on a robotic mission to repair the Hubble telescope in 2007.