(Reuters) - John McCain, who died on Saturday, spent more than five years as a prisoner of war and more than three decades in the U.S. Senate representing Arizona, earning a reputation as a maverick who did not always follow the Republican Party line.

Slideshow ( 2 images )

Following are some facts about McCain.

- He was an unruly and even combative student at his Washington-area boarding school. As the son and grandson of four-star Navy admirals, McCain followed in their footsteps by attending the U.S. Naval Academy, where he continued to rebel against regulations and graduated near the bottom of his class.

- McCain’s plane was shot down during a combat mission over Vietnam in 1967. He spent 5-1/2 years in captivity, including two years in solitary confinement, and was subjected to frequent beatings and torture that left a permanent disability. In the Senate, he was a critic of harsh interrogation techniques such as “waterboarding” or simulated drowning of terrorism suspects.

- Among the military medals McCain earned were three Bronze Stars, two Purple Hearts, two Legion of Merit awards, a Silver Star and the Distinguished Flying Cross.

- McCain was working for an Arizona beer distributor - the father of his second wife, Cindy - when he entered politics. He was elected to the U.S. House of Representatives in 1982 and won the first of six Senate terms in 1986.

- McCain was seen as a maverick in his campaign for the 2000 Republican presidential nomination when he gave then-Texas Governor George W. Bush a scare by decisively winning the first of the state nominating contests. Later he fared poorly in the “Super Tuesday” nominating races and eventually conceded to Bush after a bitter campaign.

- After winning the Republican presidential nomination in 2008, McCain lost the popular vote to Democrat Barack Obama, 53 percent to 46 percent.

- In Congress, McCain was a pro-business conservative, free-market advocate and abortion foe but he voted against the Republican majority on several high-profile bills. After being cleared in the 1980s in the “Keating Five” campaign donation scandal, he made election campaign finance reform a signature concern.

- In 2017 doctors found an aggressive brain tumor during surgery in Arizona to remove a blood clot behind McCain’s left eye. He returned to Washington less than two weeks later and went against his party’s wishes by casting a dramatic late-night vote that doomed Republicans’ efforts to repeal Obama’s healthcare plan. Afterward, McCain spent much of his time in Arizona undergoing treatment and resting.

- McCain was a prominent critic of President Donald Trump. After McCain criticized Trump’s harsh rhetoric on illegal immigration, Trump disparaged McCain’s military service by saying he preferred “people who weren’t captured.” McCain, out of party loyalty, later endorsed Trump once he had secured the Republican nomination. McCain withdrew his support in October 2016 after a tape emerged in which Trump boasted of grabbing women by the genitals. McCain would go on to be a regular critic of Trump’s presidency.