The Republican senator from Arizona, who became a prominent critic of Trump, dies after battling brain cancer.

United States Senator John McCain, a former prisoner of war in Vietnam who ran unsuccessfully for US president in 2008 and became a prominent critic of President Donald Trump, died on Saturday, his office said. He was 81.

McCain, a US senator from Arizona for over three decades, had been battling glioblastoma, an aggressive brain cancer, discovered by his doctors in July 2017. He had not been at the US Capitol in 2018. He also had surgery for an intestinal infection in April of this year.

“Senator John Sidney McCain III died at 4:28pm on August 25, 2018,” read a statement from his office. “With the senator when he passed were his wife Cindy and their family,” the statement added.

No further details were immediately provided.

“My heart is broken. I am so lucky to have lived the adventure of loving this incredible man for 38 years,” Cindy McCain wrote on Twitter. “He passed the way he lived, on his own terms, surrounded by the people he loved, in the place he loved best.”

My heart is broken. I am so lucky to have lived the adventure of loving this incredible man for 38 years. He passed the way he lived, on his own terms, surrounded by the people he loved, in the the place he loved best. — Cindy McCain (@cindymccain) August 26, 2018

Meghan McCain, one of McCain’s daughters, tweeted a statement, saying: “My father is gone, and I miss him as only an adoring daughter can. But in this loss, and in this sorrow, I take comfort in this: John McCain, hero of the republic and to his little girl, wakes today to something more glorious than anything on this earth.”

I love you forever – my beloved father @SenJohnMcCain pic.twitter.com/Y50tVQvlVe — Meghan McCain (@MeghanMcCain) August 26, 2018

McCain had been in the public eye since the 1960s, when as a naval aviator he was shot down during the Vietnam War and tortured by his North Vietnamese captors during the more than five years he was held as a prisoner.

John McCain after he was released from North Vietnamese detention [Horst Faas/AP Photo]

He was edged out by George W Bush for the Republican presidential nomination in 2000, but became his party’s White House candidate eight years later. McCain lost in 2008 to Democrat Barack Obama.

William Schneider, a political analyst, told Al Jazeera that McCain will be remembered as a “beloved figure, not primarily for his ideology or his partisanship … but because of his personal qualities”.

Many of McCain’s Republican and Democratic colleagues gave their condolences.

Democratic Senator Chuck Schumer said he will be introducing a resolution to rename a congressional building in McCain’s honour.

McCain’s “dedication to his country and the military were unsurpassed, and maybe most of all, he was a truth teller – never afraid to speak truth to power in an ear where that has become all too rare”.

Mitch McConnell, the Senate majority leader, said in a statement that it “is an understatement to say the Senate will not be the same without our friend John”.

He added: “The nation mourns the loss of a great American patriot, statesman who put his country first and enriched this institution through many years of service.”

Foreign policy hawk

In the Senate, McCain was a foreign policy hawk with a traditional Republican view of world affairs.

He was a staunch supporter of Israel. In 2016, after the UN Security Council passed a resolution condemning Israel’s illegal settlement expansion in the occupied West Bank, McCain called the decision a “shameful chapter in the bizarre anti-Israel history of the United Nations”.

He specifically called out the US, who, under Obama, abstained from the vote, saying the abstention “made us complicit in this outrageous attack, and makes a troubling departure from our nation’s long, bipartisan history of defending our ally Israel in the United Nations”.

While his support for Israel almost never wavered, he appeared somewhat reserved in his reaction to Trump’s decision to move the US embassy to Jerusalem.

“I have long believed that Jerusalem is the true capital of Israel,” McCain said at the time.

“However, issues surrounding the final and permanent status of Jerusalem must ultimately be resolved by Israelis and Palestinians as part of an internationally supported peace process.”

McCain also supported Bush’s 2003 invasion of Iraq and criticised Obama for not doing more to intervene in Syria’s civil war.

He was a staunch opponent of Iran, joking in 2017 about bombing the country. He sang “bomb, bomb, bomb, bomb” Iran while on the campaign trail.

He was also an outspoken critic of the Iran nuclear deal. In 2017, he praised Trump for his Iran goals, saying he agreed with the president “that the [nuclear] deal is not the vital national interests of the United States”.

McCain v Trump

While McCain and Trump found some agreement on certain issues, including Iran, the senator was a frequent critic and target of the president as well.

As the chairman of the Senate Armed Services Committee, McCain denounced Trump for, among other things, his praise of Russian President Vladimir Putin and other leaders the senator described as foreign “tyrants”.

“Flattery secures his friendship, criticism his enmity,” McCain said of Trump in his memoir, “The Restless Wave”, which was released in May.

McCain in July had castigated Trump for his summit with Putin, issuing a statement that called their joint news conference in Helsinki “one of the most disgraceful performances by an American president in memory”. He said Trump was “not only unable but unwilling to stand up to Putin”.

McCain was also the central figure in one of the most dramatic moments in Congress of Trump’s presidency when he returned to Washington, DC, shortly after his brain cancer diagnosis for a middle-of-the-night Senate vote in July 2017.

Still bearing a black eye and scar from surgery, McCain gave a thumbs-down signal in a vote to scuttle a Trump-backed bill that would have repealed the Obamacare healthcare law and increased the number of Americans without health insurance by millions.

McCain returned to Washington, DC, after just being diagnosed to vote against bill that would have repealed Obamacare healthcare law [J Scott Applewhite/AP Photo]

Trump was furious about McCain’s vote and frequently referred to it at rallies but without mentioning McCain by name.

Even before the president took office, Trump and McCain were often at odds. After Trump in 2015 launched his presidential campaign, McCain condemned his hard-line rhetoric on immigration and said Trump had “fired up the crazies”. Trump retorted that McCain was “not a war hero”, adding: “I like people who weren’t captured.”

After Trump became president, McCain blasted what he called the president’s attempts to undermine the free press and rule of law, and lamented the “half-baked, spurious nationalism” of the Trump era.

Following the news of McCain’s death on Saturday, Trump tweeted: “My deepest sympathies and respect go out to the family of Senator John McCain. Our hearts and prayers are with you.”

Sources close to McCain have said Trump would not be invited to the funeral.

2008 presidential bid

McCain, the son and grandson of US Navy admirals, was elected to the US House of Representatives from Arizona in 1982 after more than two decades of Navy service.

He served four years in the House before Arizona voters elected him to the Senate in 1986 to replace Barry Goldwater, the 1964 Republican presidential nominee revered by conservatives.

In running for president in 2008, McCain tried to succeed an unpopular fellow Republican in Bush, who was leaving office with the country mired in wars in Afghanistan and Iraq and stuck in a financial crisis.

It was a stark contrast between McCain, then a 72-year-old veteran of the Washington establishment, and the 47-year-old Obama, who was offering a “Yes, we can” message of change.

McCain lost the 2008 presidential election alongside Sarah Palin as his vice president pick [Chris Carlson/AP Photo]

McCain tried to inject some youth and enthusiasm into his campaign with his selection of Sarah Palin, Alaska’s governor, as his running mate. But the choice backfired as her political inexperience and shaky performances in media interviews raised concerns about her qualifications.

In his new book, McCain voiced regret for not choosing then-Senator Joe Lieberman, a Democrat turned independent, as his running mate.

McCain wrote that he had originally settled on Lieberman, Democrat Al Gore’s running mate in the 2000 election, but was warned by Republican leaders that Lieberman’s views on social issues, including support for abortion rights, would “fatally divide” the party.

“It was sound advice that I could reason for myself,” McCain wrote. “But my gut told me to ignore it and I wish I had.”

Obama won 53 percent of the vote to McCain’s 45.6 percent.

On Saturday, Obama released a statement, saying that while he and McCain had their differences they shared “a fidelity to something higher – the ideals for which generations of Americans and immigrants alike have fought, marched, and sacrificed”.

‘A maverick’

In Congress, McCain built a generally conservative record, opposing abortion and advocating higher defence spending.

Still, he prided himself on his reputation as a maverick and had a history of working across party lines on immigration, climate change and campaign finance reform.

He also spoke out against the Bush administration’s use of waterboarding, a torture technique that simulates drowning, and other harsh interrogation tactics on detainees in the aftermath of the September 11, 2001, attacks.

He urged the closure of the prison for foreign terrorism suspects at the US naval base at Guantanamo Bay, Cuba, and also sponsored an anti-torture measure that passed Congress in 2005.

In a 2002 memoir, McCain wrote, “I’m an independent-minded, well-informed public servant to some. And to others, I’m a self-styled, self-righteous maverick pain in the ass.”

A dark period for McCain came as one of the “Keating Five” group of senators accused of improperly intervening with federal regulators to help political contributor and bank executive Charles Keating, whose Lincoln Savings and Loan failed in 1989 at a cost to taxpayers of $3.4bn.

McCain was cleared of wrongdoing in 1991, but the Senate Ethics Committee rebuked him for poor judgment.

On July 25, 2017, McCain delivered a Senate floor speech not long after his cancer diagnosis that was widely seen as his farewell address. It included a call to fellow Republicans to stand up to Trump and for all politicians to work together to keep America as a “beacon of liberty” in the world.

“That is the cause that binds us and is so much more powerful and worthy than the small differences that divide us,” McCain said.