Senator John McCain, a U.S. Navy hero and one of the nation's most influential Republicans, passed away from brain cancer on Saturday at age 81 after choosing to forgo treatment.

McCain would rise from an admiral's son and Naval Academy midshipman to a decorated Navy captain and then a senator and Republican presidential nominee, who earned a reputation as a maverick who takes his own counsel.

As a 31-year-old Navy pilot, McCain's plane was shot down on a bombing run, which began a searing five-year experience as a prisoner of war that would change the course of his life. He received a Silver Star for his heroism in captivity.

He has been a defense hawk and one of Congress' most influential anti-torture voices — consistently opposing the kind of brutality he suffered in Vietnam.

This is a look at his decorated war service and the lasting impact he's made on the armed services.

John McCain graduated from the Naval Academy in 1958

Navy photo

Midshipman John S. McCain III, 1958U.S. Naval History and Heritage Command

John McCain hails from a storied military family.

Navy photo

McCain Field, the U.S. Navy training base, was commissioned and named in honor of Admiral John S. McCain July 14, 1961. Standing before his plaque from left, grandson, Lt. John S. McCain III and his parents, Rear Admiral John S. McCain Jr. and Roberta Wright McCain.Associated Press photo

His father, seen here as a rear admiral in 1961, would rise to the rank of admiral — like his own father — and lead U.S. Pacific Command.

McCain became a naval aviator and flew A-4 Skyhawks

Navy photo

McCain, at right, in 1965.Library of Congress

A-4 Skyhawks were U.S. Navy carrier-based attack planes that flew some of the most dangerous missions in Vietnam. According to Naval History and Heritage Command, these subsonic jets were increasingly vulnerable to North Vietnam's air defenses by the mid-1960s and suffered the highest loss rate of any Navy plane in Vietnam. Thirty percent of the planes in McCain's squadron were battle casualties during the year he served.

On Oct. 26, 1967, McCain was on his twenty-third mission — a bombing mission over Hanoi. He took a calculated risk to attack his target at an altitude low enough to be struck by North Korea missiles and managed to release his bombs right before his plane was struck.

The missile struck one of the A-4's wings. McCain bailed out at high speed, according to Naval History and Heritage Command, which broke both his arms, his right leg and knocked him unconscious.

McCain landed in a lake and somehow regained consciousness

Navy photo

North Vietnamese guards look at magazines and notebooks left behind by departing U.S. prisoners of war at the prison known as the “Hanoi Hilton,” the day after the last American POW left the prison, March 17, 1973.Associated Press photo

He had only just resurfaced in the lake when an angry mob attacked the injured aviator.

He would be taken to the notorious Hoa Lo prison, known as the “Hanoi Hilton,” and was interrogated for four days before he was medically treated. He was vomiting, fever-ridden and drifting in and out of consciousness.

The North Vietnamese doctors tried to set his bones without anesthetics, according to NHHC, and he was eventually given surgery to operate on his broken leg.

He was a POW for five and a half harrowing years

Navy photo

McCain was released on March 14, 1973Associated Press photo

The 31-year-old officer would spend the next two years in solitary confinement. He was routinely beaten and would eventually signed a confessional of criminal wrongdoing and apology, which was permissible under the military's code of conduct, according to NHHC.

McCain would become one of the leaders of the POW resistance at the “Plantation” prison where he continued to be held.

McCain would never fully recover from the injuries he suffered in Vietnam

Navy photo

President Richard Nixon greets McCain in May 1973.National Archives

After his return to the U.S., McCain spent five months recuperating. Some wounds never fully heal. He never regained the ability to raise his arms above his head.

McCain became a U.S. Navy liasion to Congress and decided to embark on a political career rather than stay in and try to make admiral. He would retire in 1981, according to NHHC, after a distinguished career, in which he received the Silver Star, Legion of Merit with Combat 'V' and gold star, the Distinguished Flying Cross, and the Purple Heart among other awards.

McCain returned to Vietnam in 2000 and visited the former prison, which was turned into a museum.

Navy photo

John McCain tells his son Jack about his time as a Vietnam war P.O.W. as they look into a prison cell at the Hoa Lo prison in 2000.Associated Press/David Guttenfelder

McCain became a leading voice on veteran's issues.

Navy photo

John McCain and his wife Cindy show their respects during a repatriation ceremony, Vietnam, April 2000.Associated Press/David Guttenfelder

John McCain and his wife Cindy show their respects during a ceremony in April 2000 on an airfield in Vietnam, honoring the repatriation of recently recovered remains of American soldiers who had gone missing during the Vietnam war.

The McCains visited Vietnam to mark the 25th anniversary of the end of the war. Throughout his tenure in the US Senate, McCain often drew attention to veterans affairs and has remained an active advocate for prisoners of war and missing servicemembers.

He served on the Senate Select Committee on POW/MIA Affairs from 1991 to 1993 and currently serves as the chairman of the Senate Armed Services Committee.

As a maverick, McCain would make unlikely allies

Navy photo

Despite their positions on opposing sides of the aisle, McCain and Sen. Russ Feingold joined forces to reform campaign finances.Associated Press/Lauren Victoria Burke

An unlikely friendship developed between the two senators through a partnership aimed at campaign finance reform.

The resulting 2002 Bipartisan Campaign Reform Act, nicknamed the McCain-Feingold law, prohibits elected officials and candidates from pursuing soft money donations during federal elections.

McCain was the 2008 Republican presidential nominee who lost to Barack Obama

Navy photo

John McCain greets supporters during his campaign for the presidency.Associated Press/ Mary Ann Chastain

John McCain greets supporters during a door to door campaign swing in South Carolina in 2008.

The senator campaigned against junior Senator Barack Obama, who went on to win the historic election.

Read more from Business Insider: