Former President Barack Obama remembered Sen. John McCain on Saturday as a feisty, irreverent and principled patriot who fought for his beliefs but always understood that democracy would not work if politicians stray from the truth or hew to political orthodoxy.

Obama said McCain "embodied so much that is best in America,” including his "largeness of spirit" and ability to find common ground with political opponents.

"So much of our politics, our public life, our public discourse can seem small and mean and petty, trafficking in bombast and insult and phony controversies and manufactured outrage," Obama said. "It’s a politics that pretends to be brave and tough but in fact is born of fear. John called upon us to be bigger than that. He called upon us to be better than that."

He recalled how McCain, earlier this year, had asked him and former President George W. Bush to deliver eulogies at his memorial service.

It was a "precious and singular honor," Obama said, and one that showed McCain's sense of humor.

"What better way to get the last laugh than to get George and I to say nice things about him to a national audience?" Obama said.

McCain's personal invitation to the two former presidents, and one-time political opponents, was as much a gesture toward bipartisanship as it was a rebuke to President Donald Trump, who was not included.

Obama indirectly addressed the nation's deep political divisions as he praised McCain's independent streak. McCain, he said, believed "some principles transcend politics, that some values transcend party."

"John believed in honest argument and hearing other views," he said. "He understood that if we get in the habit of bending the truth to suit political expediency or party orthodoxy, our democracy will not work. That's why he was willing to buck his own party at times."

He called the late senator "an extraordinary man — a warrior, a statesman, a patriot."

Obama also spoke of his personal relationship with his 2008 presidential campaign rival, recalling private one-on-one conversations in the Oval Office where they would talk, share laughs, and discuss family and politics.

"Our disagreements didn’t go away during these private conversations,” he said. “They were real and often deep. But we enjoyed the time we shared away from the bright lights and learned from each other.”

Obama said the discussions proved to him, “We were on the same page page when all was said and done. We never doubted we were on the same team.”

The former president noted how McCain has often been described as a "maverick."

“Trust me, I was on the receiving end of some of those votes," Obama said. "But he did understand that some principles transcend politics. He considered it part of his duty to uphold those values.”

In his concession speech in 2008 at the Arizona Biltmore, McCain graciously spoke of the significance of Obama's win as the first African-American to hold the presidency.

It was such gestures, said Obama, that reflected McCain's true character and love of country.

"He made us better presidents," Obama said.