Former presidents Barack Obama and George W Bush have paid tribute to Senator John McCain at a service at Washington’s National Cathedral.
The Vietnam War hero, who became one of America’s most high-profile politicians, died a week ago from brain cancer at the age of 81.
President Donald Trump did not attend the memorial service.
The two Republicans had major differences, both personal and political.
McCain’s family made it clear that Mr Trump was not welcome at memorial services in the state of Arizona – which McCain represented as senator – and Washington, or at Sunday’s private burial service in Annapolis, Maryland, at the US Naval Academy.
Members of the Trump administration who were present include the president’s daughter Ivanka and son-in-law Jared Kushner.
McCain’s daughter Meghan was first to speak, paying an emotional tribute.
“He was a great man,” she told mourners at the cathedral.
“We gather here to mourn the passing of American greatness, the real thing, not cheap rhetoric from men who will never come near the sacrifice he gave so willingly, nor the opportunistic appropriation of those who live lives of comfort and privilege while he suffered and served.
“The America of John McCain is generous and welcoming and bold, she is resourceful and confident and secure, she meets her responsibilities, she speaks quietly because she is strong.
“America does not boast, because she does not need to. The America of John McCain has no need to be made great again, because America was always great.”
Media captionJohn McCain: US war hero, maverick and political titan
Former President Obama paid tribute to the man he defeated in the 2008 US presidential election.
He described McCain as an “extraordinary man – a warrior, a statesman, a patriot” who he said had shown great courage while in captivity in Vietnam and went on to be a fine senator who understood that principles were more important than politics.
Mr Obama said that despite their many differences, “we never doubted we were on the same team”.
Mr Bush – who defeated McCain for the Republican nomination in 2000 – paid tribute to the senator’s courage, honesty and sense of honour.
He said the senator often confronted those in power if he felt their conduct was falling short of America’s ideals with the words: “We are better than this. America is better than this.”
Other speakers included former Senator Joe Lieberman and former Secretary of State Henry Kissinger.
McCain’s body was taken from his home to a church in Phoenix, Arizona, on Thursday for a commemoration led by former US Vice-President Joe Biden.
It was then taken to Washington to lie in state at the Capitol.
On the way from the Capitol to the cathedral on Saturday morning, the cortege stopped at the Vietnam Veterans Memorial, where McCain’s wife Cindy laid a wreath.