WASHINGTON — NASA astronaut John Grunsfeld, who played a key role in repairing the Hubble Space Telescope, is leaving the agency to help lead a university-run center that supports science operations for the orbiting observatory, according to a Jan. 4 NASA news release.

Grunsfeld’s departure to become deputy director of the Space Telescope Science Institute in Baltimore marks the end of an 18-year career with the agency in which he participated in three space shuttle missions to rehab Hubble. The telescope, which has provided stunningly clear views of remote galaxies for almost two decades, will eventually be replaced by a follow-on observatory, the James Webb Space Telescope, planned for launch in 2014.

“This is an incredibly exciting opportunity for me to work at a focal point of top astronomers at the leading edge of scientific inquiry,” Grunsfeld stated in the news release. “The team at the Space Telescope Science Institute has a demonstrated record of meeting the high performance challenges of operating the Hubble Space Telescope and preparing for the James Webb Space Telescope. I look forward to working with this excellent team as we continue to explore the mysteries of the universe.”

Since joining NASA’s astronaut ranks in 1992, Grunsfeld has logged more than 58 days in space. As a Hubble repairman, Grunsfeld joined in three flights to the space telescope between 1999 and 2009, leading the final Hubble mission that installed a new wide field camera and ultraviolet telescope. In addition, Grunsfeld served on two other shuttle missions and performed eight critical spacewalks. During 2003 and 2004, he served as NASA’s chief scientist at agency headquarters in Washington, where he helped develop former President George W. Bush’s Vision for Space Exploration, which set NASA on a path to return humans to the Moon by the end of this decade.

Grunsfeld replaces Michael Hauser, who stepped down as deputy director of the Space Telescope Science Institute in October.