John McCain, a titan in the U.S. Senate, was a consistent conservative, though unafraid to buck Republican Party leadership on issues ranging from campaign finance reform to the GOP-led effort to repeal the Affordable Care Act.
He died Saturday at age 81.
While the Arizona senator and two-time presidential candidate will be remembered for his self-proclaimed "maverick" persona, it was his military bloodlines and 5 1/2 years as a prisoner of war in Vietnam that shaped much of McCain's legacy.
McCain was the son of an admiral and grew up on naval bases both in the United States and around the world. McCain's grandfather was also an admiral, making them the first father and son four-star admirals in history of the U.S. Navy.
McCain followed his father and grandfather into the family business. He was a member of the U.S. Naval Academy's Class of 1958. While at the academy, he developed a reputation as a rambunctious and insubordinate student who received more than his share of reprimands.
He also maintained another family tradition while there, earning mediocre grades in the classroom.
"My father was here and his father before him. Like me, their standing was closer to the bottom than the top of their class," McCain told a 2017 class of Naval Academy graduates.
McCain finished fifth from the bottom of his class.
Despite his poor classroom performance, he was able to become a naval aviator. By the mid-1960s, the Vietnam War was raging and McCain's squadron was drawn into battle. At one point in 1967, McCain was almost killed after a wayward rocket from a nearby bomber hit his aircraft's fuel tank just before he was to take off from the USS Forrestal.
Explosions and fires from that incident killed more than 130 people aboard, but McCain managed to escape unscathed.
On Oct. 26, 1967, while on a bombing run over the North Vietnamese capital, Hanoi, his aircraft was struck by a Vietnamese ground based anti-aircraft missile.
"Just as I released the bombs and started to pull back on the stick, a surface-to-air missile took the right wing off my airplane. My airplane violently gyrated. I ejected," McCain recounted to C-SPAN in 2003.
The impact from the ejection knocked Lt. Cmdr. McCain unconscious, and he landed in the lake below.
Both McCain's arms were broken, so was his shoulder, and his knee was shattered. He was pulled out of the water by a Vietnamese mob and was stabbed, beaten and taken to a prison commonly referred to as the "Hanoi Hilton."
Years later, as McCain reflected on this period, he said he held no ill will toward his captors.
"I don't blame them. We're in a war," McCain said in a separate interview with C-SPAN in 2017.
"I didn't like it, but at the same time when you are in a war and you are captured by the enemy, you can't expect to have tea," McCain said.
Because of the prominence of McCain's family, his captors saw in him potential for propaganda and offered him early release. But McCain repeatedly refused the offer because his fellow POWs would not be released as well.
He spoke about that shortly after his release in 1973.
"A number of times they were strong in their tactics trying to get me to possibly embarrass my father and our country," McCain said.
He spent most of his time in solitary confinement and endured incessant torture.
His ordeal as a POW, however, helped fuel his political career. As a senator, he could speak with authority on military matters. Perhaps the most striking example was when he challenged the George W. Bush administration and its "enhanced interrogation" of terrorism suspects. McCain decried the practice as torture.
McCain has visited the prison where he had been a POW.
"I still despise those who inflicted pain unnecessarily on me and my fellow prisoners, but I hold no ill will toward the Vietnamese people, either North or South," he said.
The former prisoner then talked about his many friendships with many Vietnamese in the years since, adding that he always admired and respected the Vietnamese people.