In his speech that earned applause, Obama remembered his friendship with the senator, which they kept out of the spotlight.
"We didn't advertise it, but every so often over the course of my presidency, John would come over to the White House, and we'd just sit and talk in the Oval Office just the two of us. We'd talk about policy and we'd talk about family and we'd talk about the state of our politics," he explained, as first reported by Us Weekly. "And our disagreements didn't go away during these private conversations. Those were real and they were often deep, 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. Or that when all was said and done, we were on the same team."
The politician remembered feeling "sadness" and some level of "surprise" when the McCain asked him to give a eulogy at the services. He did, however, call the invitation a "singular honor," and joked: "After all, what better way to get a last laugh than to make George and I say nice things about him to a national audience?"
"And, in fact, on the surface, John and I could not have been more different... But for all our differences, for all the times we sparred, I never tried to hide, and I think John came to understand, the longstanding admiration that I had to him," Obama added.
The 44th President also appeared to make a dig at the current political administration when he brought up one of the biggest things he had in common with his once-presidential campaign competitor.
"John understood, as JFK understood, as Ronald Reagan understood, that part of what makes our country great is that our membership is based not on our bloodline, not on what we look like, what our last names are," he said. "It's not based on where our parents or grandparents came from or how recently they arrived, but on adherence to a common creed: That all of us are created equal, endowed by our creator to certain inalienable rights."
The former Illinois senator also remembered feeling "grateful," but not surprised when McCain defended his heritage during the 2008 presidential campaign.
"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," he told the crowd. "For he considered it the imperative of every citizen who loves this country to treat all people fairly."
George W. Bush delivered a eulogy during the funeral service, where he praised the late Navy veteran.
"He respected the dignity inherent in every life," he said. "A dignity that does not stop at borders and cannot be erased by dictators. Perhaps above all, John detested the abuse of power. He could not abide bigots and swaggering despots."
After a long battle with brain cancer, McCain passed away on Saturday, Aug. 25 at the age of 81.