Mark Kelly suits up during training for Endeavour's final flight. Photo Credit/NASA photo

Mark Kelly, the veteran commander who led the final flight of space shuttle Endeavour, will retire from NASA and the U. S. Navy to assist his wife, Arizona Congresswoman Gabrielle Giffords, with her recovery from a gunshot wound.

Kelly’s departure, effective Oct. 1, ends 25 years of public service for the 47-year-old aviator.

The couple plans to write a book about the life changing events of Jan. 8.  Giffords was critically wounded during a shooting spree at a Tucson gathering for her legislative constituents.

“As life takes unexpected turns, we frequently come to a crossroads,” Kelly said in a statement posted on his Facebook page. “I am at this point today. Gabrielle is working hard every day on her mission of recovery. I want to be by her side.”

NASA confirmed Kelly’s departure.

Kelly, who traveled to space four times, led shuttle Endeavour’s final flight, a 16-day mission in May to equip the International Space Station with the $2 billion Alpha Magnetic Spectrometer, an observatory with which physicists are probing the makeup of the cosmic fabric. He also served as pilot on the 2006 mission that marked the shuttle program’s final recovery from the 2003 Columbia tragedy.

“We deeply respect his achievements and his decision to focus on his family,” NASA Administrator Charles Bolden said of Kelly in a statement.

Giffords was among 13 people wounded during the shooting spree. Six more were killed.

After taking leave from NASA to rush to the Tucson hospital where his wife was undergoing emergency treatment, Kelly decided to resume his pivotal role in the Endeavour mission.

He and his crew met all of their mission objectives and more.

“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 wrote in his Facebook statement.

Giffords was later transferred to the Texas Medical Center in Houston for further treatment and rehabilitation. She was strong enough to travel to Florida to witness Kelly’s May 16 launching from a wheel chair with the families of the five other Endeavour crew members. Giffords has continued to make strides and is now undergoing rehab as an outpatient.

Kelly, 47, and his twin brother, Scott, were accepted by NASA for astronaut training in 1996.

The New Jersey native attained the rank of Captain, while serving as a carrier and test pilot and astronaut.

Kelly flew 39 missions during Operation Desert Storm.

The combat tested aviator did not spell out his long range plans, but hinted at another round of public service.

“Stepping aside from my work in the Navy and at NASA will allow me to be with (Giffords) and with my two daughters,” he said. “After some time off, I will look at new opportunities and am hopeful that one day I will again serve our country.”