John McCain – the celebrated war hero who became a six-term Republican senator and presidential nominee   has died at the age of 81.

The Arizona representative, one of the most influential US politicians of his generation, died following a battle with an aggressive form of brain cancer.

Mr McCain became known as a political maverick willing to stick to his conservative ideals rather than follow party leaders, gaining a reputation for reaching across the political aisle and trying to work with Democrats.

Barack Obama, who triumphed over Mr McCain in the presidential 2008 election was among those to lead the tributes.  He said Mr McCain and he shared a “fidelity to something higher – the ideals for which generations of Americans and immigrants alike have fought, marched, and sacrificed.”

Mr Obama said the two political opponents “saw our political battles, even, as a privilege, something noble, an opportunity to serve as stewards of those high ideals at home, and to advance them around the world.”

“Few of us have been tested the way John once was, or required to show the kind of courage that he did. But all of us can aspire to the courage to put the greater good above our own,” Mr Obama added. “At John’s best, he showed us what that means. And for that, we are all in his debt.”

Before beginning a 35-year career in Congress, he served as a pilot in the US Navy, enduring a six-year spell in a prisoner of war camp after he was shot down during the Vietnam War.

John McCain’s best moments

In the final months of his life, the ailing senator proved a thorn in the side of Donald Trump, with whom he had clashed in the past, ending the president’s attempt to scrap Obamacare. In one of his final significant acts as a senator, Mr McCain voted in 2017 against a new healthcare bill dooming it with a dramatic thumbs-down on the Senate floor.

Mr Trump, who made his animosity towards Mr McCain’s decision over the healthcare vote clear and once criticised the Arizona senator for being taken prisoner during the Vietnam War released a brief statement. Hr said his “deepest sympathies and respect” went out to Mr McCain’s family.

Former President George W Bush, who defeated Mr McCain for the 2000 Republican presidential nomination, called his one-time political rival “man of deep conviction and a patriot of the highest order” and a “friend whom I’ll deeply miss.”

Mr McCain’s steadfast nature provoked both admiration and ire in Congress and both GOP and Democrat legislators have paid tribute to him.

Senate Majority Leader Mitch McConnell called McCain a “fascinating personality.”

“He would occasionally be in a bad place with various members, including myself, and when this would blow over it was like nothing ever happened,” Mr McConnell said after a GOP state dinner in Lexington, Kentucky. “He also had a wicked sense of humour and it made every tense moment come out better.”

Mr McCain was born to mother Roberta and father John S McCain Jr, a senior naval officer, on a US military base in the US-governed Panama Canal Zone in 1936.

Following his father and grandfather, who both became four-star admirals, into the forces, he enrolled in the United States Naval Academy in Annapolis, Maryland.

He served as a pilot based on various aircraft carriers during in the Vietnam War, before he was captured after being shot down on a bombing mission over Hanoi in October 1967.

Over the following six years, Mr McCain was held as a prisoner-of-war, often being tortured and sustaining injuries that left him with life-long physical disabilities.

He was released in 1973 after refusing an early repatriation offer from his captors when they discovered his father was a high-ranking Naval officer.

Mr McCain entered politics in the early 1980s after leaving the Navy and was elected to the House of Representatives in 1983. He was elected to the Senate in 1987 and failed to gain the Republican nomination for president in 2000, losing out to George W Bush.

In 2008 he did win the nomination, but lost out to Mr Obama, a man more than two decades his junior who often appeared more youthful and energetic on the campaign trial compared to the then-72-year-old Mr McCain.

In his final years in politics, he often traded blows with Mr Trump, keeping up his criticism of the White House even while undergoing severe medical treatment in Arizona.

In July, he issued a searing rebuke of Trump’s summit with Russian President Vladimir Putin, calling it a “tragic mistake” and “one of the most disgraceful performances by an American president in memory.”

Mr McCain is likely to be buried in the next week, and plans to honour his legacy will no doubt come quickly. The leading Democrat in the Senate, Chuck Schumer of New York has already announced that he wants to name the Senate building that housed Mr McCain’s suite of offices after the Arizona senator, who served as chairman of the Commerce Committee and the Senate Armed Services Committee.

“As you go through life, you meet few truly great people. John McCain was one of them,” Mr Schumer said. “Maybe most of all, he was a truth teller – never afraid to speak truth to power in an era where that has become all too rare.”

Associated Press contributed to this report