For more on the late senator’s legacy, tune in to “John McCain: For Whom the Bell Tolls” Saturday at 9 p.m. ET/PT.

Washington CNN  — 

Former President Barack Obama lauded John McCain’s efforts to push the nation to rise above “mean and petty” politics in his tribute Saturday to the Arizona Republican, who served for more than three decades in the Senate.

“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. It’s a politics that pretends to be brave and tough, but in fact is born of fear,” Obama said in a eulogy for McCain at a memorial service at Washington National Cathedral. “John called on us to be bigger than that. He called on us to be better than that.”

Obama, who was McCain’s rival in the 2008 presidential race, added, “That’s perhaps how we honor him best, by recognizing that there are some things bigger than party, or ambition, or money, or fame, or power, that there are some things that are worth risking everything for.”

McCain “never hesitated to tell me when he thought I was screwing up, which by his calculation was about once a day,” the Democratic former president said, drawing some laughter from the crowd. “But for all our differences, for all of the times we sparred, I never tried to hide, and I think John came to understand, the long-standing admiration that I had for him.”

Obama said it was “no secret” that McCain had a temper that was a “force of nature, a wonder to behold.”

“Not that I ever experienced it firsthand, mind you,” he quipped.

The former president also said that while McCain’s tempers would flare, the senator “was just as quick to forgive and ask for forgiveness.”

Obama recalled how during the course of his presidency, McCain would visit the White House and talk with Obama in the Oval Office about policy, family and the state of politics.

“Our disagreements didn’t go away during these private conversations. Those were real, and they were often deep,” Obama said. “But we enjoyed the time we shared away from the bright lights, and we laughed with each other, and we learned from each other. And we never doubted the other man’s sincerity or the other man’s patriotism.”

Obama spoke of the moment during one of McCain’s 2008 campaign events when a supporter told the Republican nominee she couldn’t trust Obama because he’s “an Arab.” McCain corrected the woman, telling her, “No, ma’am. He’s a decent family man.”

Obama said Saturday he was “grateful, but I wasn’t surprised” by McCain’s response.

“I never saw John treat anyone differently because of their race or religion or gender,” Obama said. “And I’m certain that in those moments that have been referred to during the campaign he saw himself as defending America’s character. Not just mine.”

Obama, along with former President George W. Bush, was personally asked by McCain to deliver a eulogy at his funeral.

“What a better way to get a last laugh than to make George and I say nice things about him to a national audience,” Obama joked.

McCain died at the age of 81 last Saturday after stopping treatment for glioblastoma, an aggressive brain tumor. He was honored at a memorial service Thursday at the Arizona state Capitol. On Friday, the senator lay in state in the US Capitol, the 31st person to be given the rare honor.

A private service will take place at the US Naval Academy in Annapolis, Maryland on Sunday, and McCain will be laid to rest in the US Naval Academy Cemetery.