This story was updated at 4:23 p.m. EDT.
Veteran astronaut Mark Kelly, the husband of Arizona congresswoman Gabrielle Giffords, announced his retirement from NASA and the U.S. Navy today (June 21) after more than two decades of service.
"Today, I am humbled to announce that after 25 years of service to our country, I am retiring from the United States Navy and leaving NASA, effective Oct. 1," Kelly, 47, said in a statement he posted on Facebook.
Kelly's career at NASA began in 1996, and has included four space shuttle flights, two each on the shuttles Endeavour and Discovery. He joined the Navy as an aviator in 1987 and currently holds the rank of captain.
On May 16, Kelly commanded Endeavour on its STS-134 flight, the second-to-last mission of NASA's 30-year space shuttle program. Kelly landed Endeavour for the last time on June 1 at Kennedy Space Center in Florida. [Photos: Shuttle Endeavour's Final Landing]
In early January, Kelly's wife, Gabrielle Giffords, suffered a gunshot wound to the head during an assassination attempt at a constituent meeting in Tucson. After critical surgeries and intense rehabilitation, Giffords was able to travel to Florida in April and May to watch her husband's launch into space.
During Giffords' recovery, Kelly stayed by her side and eventually she was moved to a Houston-area hospital to allow Kelly to resume training for Endeavour's final mission. NASA had tentatively named a backup commander for the flight, but Kelly later resumed training as Giffords' condition improved.
"I will be forever grateful to the NASA managers who trusted me with this enormous responsibility during such a difficult period in my personal life and to those leaders in the United States Navy who prepared me to handle these challenging times," Kelly said.
Giffords and Kelly are writing a memoir together that will detail their careers, relationship, and the tragic Tucson shooting that killed six people and wounded Giffords and 12 others, according to the Associated Press. The book will be published by Scribner and released at a date to be determined.
"We salute Commander Mark Kelly and his contributions to NASA as an extremely accomplished member of the astronaut corps and the final commander of the space shuttle Endeavour," NASA Administrator Charles Bolden said in a statement. "We deeply respect his achievements and his decision to focus on his family. We continue to send out our thoughts and prayers to Mark and his wife, Rep. Gabrielle Giffords, as she makes a remarkable recovery. We know that Mark will continue to do great things for his country no matter what he chooses to do next. He has helped us build a space program poised to take advantage of the many opportunities in our bright future."
Kelly is from West Orange, NJ, and served in the U.S. Merchant Marine before joining the Navy. He flew 39 combat missions during Operation Desert Storm before becoming a test pilot and NASA astronaut.
Kelly stated that despite his departure from NASA, he remains confident in the future of the nation's space program.
"I know that as our space program evolves, there are those who will question NASA's future," Kelly said. "I am not among them. There isn't a group more dedicated to its mission or more capable than the outstanding men and women of NASA. Exploration is a critical component of what makes our country great. We will continue to explore and NASA will continue to lead that effort."
The decision to retire will allow Kelly to spend more time with his family, and to continue to focus on his wife's recovery, he said.
"As life takes unexpected turns we frequently come to a crossroads," Kelly said. "I am at this point today. Gabrielle is working hard every day on her mission of recovery. I want to be by her side. Stepping aside from my work in the Navy and at NASA will allow me to be with her and with my two daughters. I love them all very much and there is no doubt that we will move forward together. After some time off, I will look at new opportunities and am hopeful that one day I will again serve our country."
Get the Space.com Newsletter
Breaking space news, the latest updates on rocket launches, skywatching events and more!
Denise Chow is a former Space.com staff writer who then worked as assistant managing editor at Live Science before moving to NBC News as a science reporter, where she focuses on general science and climate change. She spent two years with Space.com, writing about rocket launches and covering NASA's final three space shuttle missions, before joining the Live Science team in 2013. A Canadian transplant, Denise has a bachelor's degree from the University of Toronto, and a master's degree in journalism from New York University. At NBC News, Denise covers general science and climate change.