At the memorial service he had carefully planned, John McCain managed to deliver a final and defiant rebuke to the man who wasn't there, whose name was never uttered.

President Donald Trump was one of the few of the nation's political elite, past and present, who weren't among the more than 3,000 mourners at the National Cathedral for an emotional, affectionate, often humorous and sometimes fierce outpouring in honor of the Arizona senator who was twice defeated in his efforts to win the White House.

In what amounted to a statement of fundamental American principles, he had asked the two men who vanquished those aspirations to deliver eulogies: Former President George W. Bush, who won the Republican nomination over McCain in 2000, and former President Barack Obama, who won the presidency against him in 2008.

More: Cindy McCain weeps duringpowerful rendition of 'Danny Boy'

Before a word was said, his invitation and their acceptance in itself signaled an endorsement of the importance of civility, humility and bipartisanship – qualities that now seem to be a rare commodity in the capital.

Obama's closing words were among the most direct about the current state of American politics, including the relentless partisanship that divides Congress into competing party fortresses and the divisive rhetoric that has become the signature of the current president.

More: Meghan McCain jabs Trump, says 'America was always great'

"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."

Soon after the service had begun, Trump departed the White House dressed for golf and wearing a white "Make America Great Again" cap. He already had posted morning tweets denouncing "the corruption" of the FBI and the Justice Department. By the time he arrived at Trump National Golf Club in Loudoun County, Virginia, he had tweeted his unhappiness with Canada and his willingness to abandon NAFTA. "We will be far better off," he said of the free-trade agreement.

Three miles away, at the cathedral, former Connecticut Senator Joe Lieberman was speaking from the lectern about his departed friend.

The message from the cathedral to the president was unmistakable, a declaration of the Washington establishment to the sitting president that was surely unprecedented.

"McCain staged his death like the final act of Shakespeare's Richard III, every legitimate force in the state, living and dead, combined against the wicked king," tweeted David Frum, a Republican speechwriter in the George W. Bush White House.

Trump and McCain were members of the same party but, it often seemed, from different worlds. During the 2015 campaign, in a jaw-dropping jab, Trump said McCain was "not a war hero" even though he had spent more than five years as a POW in Vietnam. "I like people that weren't captured," Trump said. When McCain died last week of a brain tumor, at age 81, Trump delayed for two days before relenting to criticism and issuing a statement praising him, and ordering American flags left at half-staff until the senator's internment Sunday.

Present in the pews were not only three former presidents – Obama, Bush and Bill Clinton. There were also all four of the national candidates from the bitterly disputed 2000 election – Bush and Dick Cheney, Al Gore and Lieberman. Others who have felt the pain of losing presidential races were there: Hillary Clinton and John Kerry and Bob Dole. There were at least three Nobel Prize winners. And the current congressional leadership, Republican and Democratic, all of whom had their battles with McCain.

Most wrenching was the eulogy delivered by Meghan McCain, remarks that were emotional and intense. She spoke with force about her father even as she fought back tears.

"We gather to honor the passing of American greatness, the real thing, not cheap rhetoric from men who will never come near the sacrifice he gave so willingly, nor the opportunistic appropriation of those who live lives of comfort and privilege," she said.

"The America of John McCain has no need to be made great again, because America was always great."

With that, the congregation in the sanctuary broke into applause.

A few hours later, Trump tweeted again, four words in all capital letters, a sign that he had heard the message from McCain's service and was unpersuaded. "MAKE AMERICA GREAT AGAIN!" he posted.