Tributes from former US presidents and across the political spectrum have poured in for Republican Senator John McCain, who has died aged 81. Barack Obama, who beat him to the White House in 2008, said they had shared a “fidelity to something higher”. George W Bush described him as “a patriot of the highest order”.
President Donald Trump, whom McCain had strongly criticized, tweeted his deepest sympathies to McCain's family but did not comment on his life.
By contrast, First Lady Melania Trump thanked the late senator for his service to the nation.
Our thoughts, prayers and deepest sympathy to the McCain Family. Thank you Senator McCain for your service to the nation.
Sources quoted by US media said Mr Trump would not be invited to the funeral and the current administration would probably be represented by Vice President Mike Pence.
Former Presidents Obama and George W Bush are expected to give eulogies.
McCain was diagnosed with an aggressive brain tumor in July last year and had been undergoing treatment. But on Friday his family announced he had decided to discontinue that treatment.
A statement from his office on Saturday said McCain had died in Arizona surrounded by family members.
His family said he would lie in state in Phoenix, Arizona, and in Washington DC before a funeral at the Washington National Cathedral and his burial in Annapolis, Maryland.
He was a public servant in the finest traditions of our country, Mr Bush said. And to me, he was a friend whom I'll deeply miss.
Mr Obama said that despite being his Democratic rival, they had shared the ideals for which generations of Americans and immigrants alike have fought, marched and sacrificed.
Sarah Palin, who was McCain's running mate during his 2008 presidential bid, said the world had lost an American original.
From outside the US, Israeli Prime Minister Benjamin Netanyahu hailed McCain as a great American patriot whose support for Israel never wavered.
French President Emmanuel Macron tweeted in English that McCain was a true American hero. He devoted his entire life to his country. Germany's chancellor, Angela Merkel, called McCain a tireless fighter for a strong trans-Atlantic alliance. His significance went well beyond his own country.
Canadian Prime Minister Justin Trudeau said McCain's lifetime of public service had been an inspiration to millions.
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 place he loved best.
As a hearse brought Mr McCain's body from his ranch in Sedona, Arizona, to a funeral home in Phoenix, people waving flags lined the street.
The son and grandson of Navy admirals, McCain was a bomber pilot during the war in Vietnam. When his plane was shot down, he spent more than five years as a prisoner-of-war. While being held by his captors, he suffered torture that left him with lasting disabilities.
In politics, he took a conservative line on many issues, opposing abortion and advocating higher defense spending. He backed the 2003 invasion of Iraq and criticized President Obama for not intervening more in the Syrian civil war.
However, he also gained a reputation as a Republican maverick who was willing to cross party lines on a range of issues.
In July last year, just after his diagnosis, he took part in a late-night Senate session and gave the deciding vote - with a thumbs-down gesture - against partially repealing the contentious Obama-care healthcare law. The move reportedly infuriated Mr Trump.
McCain also criticized President Trump's hard-line rhetoric on illegal immigration and his attacks on the media.
McCain never won the top political office for which he longed. Throughout his life, however, he offered a full-throated defense of an America that was active and engaged in the world. In his final years he sparred with Mr Trump over the direction of the Republican Party and the principles it should embrace.
It's an open question as to whether these views have a future in his party. McCain, however, fought for what he believed was right until the very end.