Sen. John McCain, R-Ariz., who died Saturday after a battle with aggressive brain cancer, served more than 30 years in the U.S. Senate and was an ardent supporter of the armed forces.

The senator, who was tortured while he spent nearly five and a half years as a prisoner of war in Vietnam, was “larger than life,” Tom Callender, a Navy affairs analyst at the Heritage Foundation, a think-tank based in Washington D.C., told Fox News.

"There will be a void for a long time.” — Tom Callender

“While there will be others [like him], there will be a void for a long time,” Callender said. "Someone will rise, but it will not be the same. It’s tough to fill those shoes.”

Here's a look back at McCain's military career.

McCain’s military roots

McCain was born Aug. 29, 1936, at a military air base in the Panama Canal Zone, which, according to the History Channel, was under American control at the time.

McCain, the son of a four-star Navy admiral, spent the majority of his childhood on naval bases along with his older sister Sandy and younger brother Joe.

After graduating in 1954 from an Episcopal boarding school in Virginia, McCain attended the U.S. Naval Academy, graduating in 1958.

McCain’s interest in the military came naturally: His father, John S. McCain Jr., was a decorated Navy admiral, as was Sen. McCain’s paternal grandfather, John S. McCain Sr.

His grandfather and father, who both served during World War II, retired with a four-star rank, Callender said.

The USS John S. McCain was named after both his grandfather and father. In August 2017, the ship was involved in a collision near Singapore, killing 10 sailors.

“[McCain] came from a naval aristocracy,” Dr. John Sherwood, a naval historian at the Naval History and Heritage Command, told Fox News.

McCain’s father, who was a submariner during World War II, also served in the Vietnam War. At that time, John S. McCain Jr. was in charge of all U.S. military forces in the Pacific Ocean, Callender said, even leading bombing missions on Hanoi while his son was a prisoner of war.

“There was always a chance a bomb could land where his son was,” Callender said. “But he had to do his job.”

“Being in command of all U.S. forces in the Pacific and the stress of maybe his son being killed — it took a lot of balance. But he did so with honor,” Sherwood added.

A 'reckless, adventurous' youth to a 'changed man'

McCain was a “rule breaker at the [Naval] Academy,” Callender said, adding that McCain graduated with a low-class rank.

After graduating from flight school in 1960, McCain flew with the VA-65 squadron on the aircraft carriers USS Intrepid and USS Enterprise.

McCain, who at this point in his life was still a bit reckless, Callender said, had three non-combat-related crashes during this time — once flying too low over a town in southern Spain, colliding with power lines. However, he escaped the accident relatively unscathed.

In another close call, McCain crashed his plane into Corpus Christi Bay.

“A notable aspect of his naval aviation career was luck,” Sherwood said.

“If he had been any other pilot, [the Navy] might’ve not given him another chance,” Callender said.

More than anything, Sherwood said, it was McCain’s time in the Naval Academy that helped him prepare to be a POW, though he didn’t know it at the time. Sherwood added the academy was a “rough place” where students were expected to balance the “rigorous academic and physical programs” in addition to socializing and “making a name for themselves” among their fellow shipmen.

McCain’s hasty demeanor changed after he spent five and a half years as a POW during the Vietnam War, Callender said.

“He was a changed man," he added.

Combat duty and time as a prisoner of war

In the 1960s, McCain volunteered for combat duty during the Vietnam War, during which time he flew carrier-based attack planes.

After surviving a massive fire onboard the aircraft carrier USS Forrestal that killed 134 sailors, McCain transferred to VA 163. While conducting a bombing run on Hanoi later that same year, his plane was shot down. McCain landed in a nearby lake, breaking both of his arms and one of his legs in the crash. He nearly drowned before Northern Vietnamese soldiers captured him, Callender said.

“Before he was shot down, he received a warning that a missile had been shot against him. He ignored the warning because he thought he could outmaneuver the missile,” Sherwood said.

Moments after being captured, one of the soldiers “slammed a rifle butt down on my shoulder, and smashed it pretty badly. Another stuck a bayonet in my foot. The mob was really getting uptight,” McCain later recalled in an essay.

McCain was moved to Hoa Lo prison, more commonly known at the time as “Hanoi Hilton.”

Eventually, McCain’s North Vietnamese captors discovered he was the son of a well-known admiral and offered to let him go. But McCain refused.

“He knew it would be powerful propaganda to show that [the Northern Vietnamese] were merciful,” Callender said, adding that McCain refused to break Article III of the Military Code of Conduct — to "accept neither parole nor special favors from the enemy." Captured American soldiers are directed to give the enemy only their name, rank and serial number.

McCain told his captors he would accept freedom only if the other POWs — many of whom had been there long before him — were released as well, Callender said. But his request was denied.

From there, McCain was severely tortured, did not receive proper medical treatment for his injuries and was forced into two years of solitary confinement, Callender said.

“That was common back then — they did not get him good medical treatment for a long time,” Callender said, adding that McCain was not fed well and lived in deplorable conditions during his time as a POW.

“He was by far in the worst condition out of everyone who arrived there,” Sherwood added. “It’s a testament to his heroism.”

In March 1973, after years of torture, McCain and other POWs were released. He later received the Silver Star, Bronze Star, Purple Heart and Distinguished Flying Cross.

“It changed him,” Callender said. That experience taught him “everyone has a breaking point.”

Even in the harsh conditions, McCain remained even-keeled through the whole experience, even boosting the morale of his fellow POWs, Sherwood said.

"It changed him." — Tom Callender, on McCain's time as a POW

“As a historian, I always found it interesting that he didn't really talk about it [his time as a POW] unless asked,” Sherwood said, suggesting McCain’s mentality was different than that of many other former POWs he’s studied. “He saw it as part of his service to the country, and didn’t want to dwell on past service but what he could do today, here and now.”

Return to duty

Aside from the mental impact, McCain’s time as a POW left him physically changed as well, meaning he could have been medically discharged from the Navy.

But he wanted to fly again.

After months of intensive physical therapy, McCain was selected as commanding officer at Cecil Field in Jacksonville, Fla.

There, McCain led attack squadron VA 174 and was tasked with training new pilots to fly an A7 aircraft, a heavier attack aircraft than the ones McCain flew during the Vietnam War.

When McCain first arrived, the squadron was known for its poor safety record, among other things. But McCain wanted to change its reputation — and he did, Callender said.

“He reassigned people, took parts from broken aircraft to fix others — it was his forceful personality and sheer will that dragged his command along. It ended up being a drastic improvement.”

Under McCain’s command, the squadron won the Aviation Safety Award for having the most number of flight hours without an accident, Callender said.

Callender said McCain’s leadership during this time proved “his ability to get people to do things.”

A new chapter

In 1976, McCain started his “next chapter," Callender said. That year, he was appointed to be the Navy’s liaison to the U.S. Senate, a position he served in until 1981.

“He saw how he could help the Navy from that angle,” Callender said, adding that McCain was a huge proponent of a strong military from the moment he stepped into the role.

Later, McCain was elected to the U.S. House of Representatives and then the U.S. Senate. During this time in his career, McCain earned the nickname "Maverick" for his willingness to disagree with his party on critical issues. (For instance, McCain famously disagreed with President Ronald Reagan’s decision to deploy more troops to Lebanon in 1983.)

“McCain opposed Reagan’s decision because he felt that the troops wouldn’t have enough tools and support to win — much like in Vietnam,” Callender said. “[He was] always breaking the rules and pushing boundaries for what he felt was important."

National Defense Authorization Act

In 2017, McCain, who served as chairman of the Senate Armed Services Committee, was a key player behind the National Defense Authorization Act.

President Trump signed the Act on Dec. 12, 2017. It was one of McCain’s last efforts to rebuild the military, thus making the legislation so poignant, Callender said.

“As we move forward with consideration of the NDAA, I stand ready to work with my colleagues on both sides of the aisle to pass this important legislation and give our military the resources they need and deserve. We ask a lot of our men and women in uniform, and they never let us down. We must not let them down. Their service represents the best of our country, and this Congress should always honor their sacrifice,” McCain said on the Senate floor in September 2017.

One of the 'great naval figures of the 20th century'

McCain had “tough” legacies to live up to, Callender said, citing the senator's father and grandfather. But “he always felt he could do more good on the politics side."

Overall, Callender thinks McCain did more in Congress for the military than he ever could’ve done by staying in the Navy.

“His legacy will be felt much more than his grandfather’s or father’s as time goes on,” Callender said.

McCain is "one of the great naval figures of the 20th century and someone who the Navy looks up to today as a symbol of heroism and a symbol of the sailor triumphing over adversity,” Sherwood added.

In the end, McCain “may not have had the impact he’s had if it had not been for his experiences," Callender said. "He has never been what people want to hear. But whether you agreed with him or not, he was always fighting for what he believed and what he was passionate about."