WASHINGTON — Sen. John McCain liked to fight for causes larger than himself.

He fought for his country as a Navy pilot during the Vietnam War. Despite being tortured in a Vietnamese prison camp, he stood up for his fellow prisoners of war by refusing the early release his captors offered him because he was an admiral's son.

In politics, he fought to defeat Democrats at the polls, to bend the GOP toward his brand of Republicanism and for any number of policies he considered vital — from weakening national parties' dominance of campaign financing to prohibiting the U.S. from torturing suspected terrorists.

But McCain's legacy will be about a trait, more than any individual cause, that was both larger than himself and is in perilously short supply in American politics right now: honor.

In the hours after McCain's death Saturday, it was a word that showed up repeatedly in statements from Republicans and Democrats, a group so politically diverse it included former Vice President Joe Biden, a Democrat who was on the ticket when Barack Obama defeated McCain for the presidency in 2008, and Sen. Ted Cruz, a Texas Republican who is among the most conservative members of Congress.

Even those who didn't use the word touched on it.

"[W]e shared, for all our differences, a fidelity to something higher — the ideals for which generations of Americans and immigrants alike have fought, marched and sacrificed," Obama said in a statement. "We saw our political battles, even, as a privilege, something noble, an opportunity to serve as stewards of those high ideals at home, and to advance them around the world. We saw this country as a place where anything is possible — and citizenship as our patriotic obligation to ensure it forever remains that way."

It was during a memorable and unscripted moment toward the end of the 2008 campaign that McCain's honor revealed itself to Obama and his supporters.

A woman at one of McCain's rallies in York, Pennsylvania, questioned Obama's heritage.

“I can’t trust Obama," she said. "I have read about him, and he’s not, he’s not — he’s an Arab."

McCain wouldn't hear it, even though he found himself on the wrong side of the crowd.

"No ma’am,” McCain said. “He’s a decent family man, a citizen that I just happen to have disagreements with on fundamental issues, and that’s what this campaign is all about. ... I want everyone to be respectful, and let’s make sure we are. Because that’s the way politics should be conducted in America.”

Many in the crowd booed, and later, Arab-Americans expressed disappointment at the implication that they weren't decent family people. But McCain's rejection of the woman's bigotry and ignorance, which almost seems quaint now, remains at the core of the great American political experiment. The republic only survives if adversaries are able to respect one another and the idea that differences should be resolved peacefully in the political arena.

Surely, many future supporters of President Donald Trump were turned off by McCain's response that day. For years, McCain was pilloried by those on the right who thought he was insufficiently loyal to the GOP and those on the left who were infuriated that he was lionized as a "maverick" when he usually toed the party line.

McCain's critics often blew themselves up trying to get the better of him.

Then-House Speaker Dennis Hastert once responded to McCain's suggestion that tax cuts might be sacrificed during wartime by saying he would take McCain to visit wounded veterans at the Walter Reed Military Medical Center outside Washington so that McCain — who spent five and half years of his life as a prisoner of war — could learn about sacrifice.

Wesley Clark, the onetime presidential candidate and former supreme allied commander of NATO, lost his role as surrogate for Obama after saying "getting shot down in a plane" didn't qualify McCain to be president. Trump echoed that line seven years later, saying he liked people "who weren't captured."

In that way, and in others, McCain benefited politically from his status as a high-profile war veteran. But he was reluctant to term himself a "war hero" or to talk about his experiences explicitly in the political realm. There was honor in that, too.

McCain could be harsh and petty in the midst of a Washington battle, but his tendency to get under the skin of adversaries was one of his great political strengths. But it wasn't as powerful as his ability to let go of grudges to find common cause with onetime opponents.

On Saturday, President George W. Bush, who defeated McCain in a bitter primary in 2000 and sometimes found himself at odds with McCain on policy matters after that, called McCain "a friend whom I'll deeply miss."

Senate Minority Whip Dick Durbin, D-Ill., who arrived with McCain as a member of the freshman House class of 1983, described the way McCain was able to work with almost anyone.

"There were times when we were cursing each other and staring one another down and other times we were in a warm embrace," Durbin said earlier this week. "That was the nature of a relationship with John McCain. When he was by your side as a friend and ally, you couldn't have had a stronger ally, a stronger friend, and a better result."

The most notable exception: Trump.

In a condolence tweet Saturday night, the president declined to say anything about the late senator, even when a nod to his service would have been easy and expected.

My deepest sympathies and respect go out to the family of Senator John McCain. Our hearts and prayers are with you! — Donald J. Trump (@realDonaldTrump) August 26, 2018

Trump, who often criticized McCain during campaign rallies even as McCain battled brain cancer, also refused to say his name during a speech at a bill-signing event for a defense-authorization measure named after McCain at Fort Drum earlier this month and at an Ohio GOP fundraiser Friday night when it was clear McCain's death was imminent.

McCain was the first person to point to his own imperfections — including times when he didn't behave as he would have liked — but he conducted himself with a kind of honor that is as important to the functioning of American democracy as it is rare in today's political environment. That will be his legacy.

CORRECTION: (Aug. 27, 2018, 8:42 a.m. ET): An earlier version of this article misstated the location of a campaign rally at which McCain corrected a woman who said Obama was "an Arab." It took place in Lakeville, Minnesota, not York, Pennsylvania.