The president, who mocked McCain’s capture in Vietnam during the 2016 campaign, jabbed at the senator even after his illness for voting against Republican efforts to roll back President Barack Obama’s health care law.

"As you go through life, you meet few truly great people. John McCain was one of them."Senator Chuck Shumer

Former presidents, including those who blocked McCain’s own White House ambitions, offered emotional tributes.

Obama, who triumphed over McCain in the 2008 election, said that despite their differences, McCain and he shared a “fidelity to something higher – the ideals for which generations of Americans and immigrants alike have fought, marched, and sacrificed”.

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”.

Former President George W Bush, who defeated 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”.

Bush was among those expected to speak at McCain’s funeral.

McCain was the son and grandson of admirals and followed them to the US Naval Academy.

John McCain believed that every citizen has a responsibility to make something of the freedoms given by our Constitution, and from his heroic service in the Navy to his 35 years in Congress, he lived by his creed every day. https://t.co/946T7PnG53

“He also had a wicked sense of humour and it made every tense moment come out better.”

Former vice president Joe Biden, who developed a friendship with McCain while they served together in the Senate, said the Arizona politician will “cast a long shadow”.

“The spirit that drove him was never extinguished: we are here to commit ourselves to something bigger than ourselves,” Biden said.

When I was an intern in the Senate, I got my haircut in the Senate barber shop. Halfway through, John McCain came in & sat in the chair next to me. He made a point of saying hello to me, the lowly intern, and said he hoped I would see the virtues of public service. RIP, Senator.

McCain is expected to be remembered in Arizona and Washington before being buried, likely this week, at the Naval Academy Cemetery on a peninsula overlooking the Severn River.

Senator Chuck Schumer announced that he wants to name the Senate building that housed 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,” Schumer said.

McCain’s wife Cindy said she was heartbroken by the death of an “incredible man”.

Deeply saddened to know of the death of Senator John McCain whose support for, and friendship with, the people of Kurdistan shall remain in our memory, May he rest in eternal peace.

In a post on Twitter, she said: “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.”Daughter Meghan McCain described her father as a “great fire who burned bright”.

She said: “We lived in his light and warmth for so very long. We know that his flame lives on, in each of us.

“His love and his care, ever present, always unfailing, took me from a girl to a woman – and he showed me what it is to be a man.”