Former President George W. Bush, John McCain's one-time bitter political rival, recalled the late senator Saturday as a man who loved freedom, detested the abuse of power and wasn't afraid to take on anyone, including presidents.

"He was honest, no matter who it offended," Bush said in his eulogy at the National Cathedral. "Presidents were not spared. He was honorable, always recognizing that his opponents were patriots and human beings."

McCain's personal invitation to Bush, and to former President Barack Obama, to speak at the memorial service, was as much a gesture toward bipartisanship as was his pointed refusal to invite President Donald Trump.

"John was above all, a man with a code," he said. "He lived by a set of virtues."

"He loved freedom with a passion of a man who knew its absence," he said.

Read:George W. Bush's full eulogy to former political opponent John McCain

Bush said that McCain always recognized that his opponents "were still patriots and human beings."

Above all, the former president said, "he detested the abuse of power, he could not abide bigots, and swaggering despots."

The invitation by McCain to Bush to deliver a eulogy was especially striking, given the animosity between the two men over the 2000 GOP primary.

In that contest, McCain — riding the "Straight Talk Express" — had come out of nowhere to take the New Hampshire primary that year and faced a critical re-match with Bush in South Carolina.

Bush won that bruising battle that was marked by scurrilous, racially tinged attacks on McCain. Among them, a whisper campaign that McCain had fathered a black child out of wedlock. McCain's dark-skinned daughter, Bridget, was adopted from Bangladesh, but the subrosa attacks may well have played a role in McCain's defeat in that southern bastion.

During a heated break at one South Carolina debate, Bush apparently tried to mollify McCain by saying he knew nothing about the origin of the rumors, at one point grasping McCain's hands. To which McCain barked, according to Time magazine, "Don't give me that s---t. And take your hands off me."

Bush recalled the one-time strain between the two political warhorses during that period, saying that "for John and me, there was a personal journey, our hard-fought political history."

"Back in the day, he could frustrate me, and I know he'd say the same thing about me," Bush said to laughter from the congregation. "But he also made me better."

Eventually, he said, their bitter rivalry "melted away."

"I got to enjoy one of life's great gifts," Bush said. "The friendship of John McCain, and I'll miss him."

Bush said McCain was a passionate defender of fairness and justice, who would take on presidents and admirals to "stand up for the little guy."

“John’s voice will always come as a whisper over our shoulder – we are better than this, America is better than this,” Bush said, adding: "We will remember him as he was: unwavering, undimmed, unequaled."