NASA commander Mark Kelly announced today on his Facebook page that he is retiring from the U.S. Navy and leaving NASA, effective October 1.

“Words cannot convey my deep gratitude for the opportunities I have been given to serve our great nation,” he wrote. “From the day I entered the United States Merchant Marine Academy in the summer of 1982 to the moment I landed the Space Shuttle Endeavour three weeks ago, it has been my privilege to advance the ideals that define the United States of America.”

Kelly is married to Congresswoman Gabrielle Giffords, who underwent surgery last month to repair her skull. She was shot in the head in January at a constituent event in Tuscon, Ariz. Kelly said he wants to be with her as she continues to recover.

“As life takes unexpected turns we frequently come to a crossroads,” he wrote. “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.”

Giffords was released last Wednesday from a rehabilitation hospital in Houston, Texas, and she made a visit to Tucson for the first time since being shot. She visited family, took a ride downtown, visited her new constituency office, attended a reunion with staffers and, from the air, viewed the devastation from the Monument Fire near Sierra Vista, which is part of her congressional district.

She returned to Houston on Sunday where she will continue rehab therapy as an outpatient.

More than 200 people have left comments on Kelly’s Facebook page since his announcement, wishing the family well.

“Thank you for a job well done!” said a commenter named Will Bryan. “You have been an inspiration as both a member of the world’s greatest military and as a member of NASA! May The Great Lord bless you, your daughters, and Gabby!”

Another well-wisher named Vivian Whitaker said, “Thanks for your service to our country and NASA. Thanks too for sharing your life experiences. God bless you and Gabby as you enter a new chapter of your life together.”

Kelly said he might return to public service someday.

“After some time off, I will look at new opportunities and am hopeful that one day I will again serve our country,” he said.

Kelly also told The Arizona Republic that he and Giffords will work on a memoir detailing the events of their lives before and after she was shot.