Former President Barack Obama said that John McCain's request for him to speak at his memorial service showed the senator's ability to see past people's differences.

McCain (R-Ariz.), a six-term senator and two-time presidential candidate, died of brain cancer on Aug. 25 at the age of 81.

A public memorial service for him was held Saturday at the Washington National Cathedral.

"For all our differences, I never tried to hide… the longstanding admiration I had for him," he said.

Sgt. Joey Jones on McCain's Military Impact: War Doesn't Have to Steal 'Your Will for Tomorrow'

Obama, McCain's opponent in the 2008 presidential election, added that the senator understood that certain principles transcend Democrat or Republican beliefs.

"He did understand that some principles transcend politics. Some values transcend party."

He noted how McCain's belief in hearing other views led him to, at times, abandon the principles of the GOP.

Obama also said that he and McCain would oftentimes chat at the White House, many times about the state of America's politics.

"We laughed with each other, and we learned from each other," he said. "We never doubted the other man's sincerity or the man's patriotism."

He concluded his remarks by noting that McCain's values showed that the right to fight for the country is open and demanded of all citizens.

Watch Obama's remarks above.

Gregg Jarrett: AG Sessions 'Will Be Fired' After Midterms Due to Carter Page Surveillance

He 'Never Looked Backwards': Former McCain '08 Campaign Manager Reflects on Senator's Life

Sen. Graham Pays Tribute to McCain: 'If You Want to Help the Country, Be More Like John McCain'