A courageous maverick, an unlikely combination of traits, John McCain has left a legacy of dignity and achievement.

McCain, who has been fighting a fatal malignant brain tumor since 2017, died Saturday at his Arizona home not long after his family announced that he had decided to stop treatment.

A son and grandson of admirals, he was destined for a Naval career. An unruly and rebellious student in high school and at the U.S. Naval Academy in Annapolis, he remained unpredictable in public life sometimes joining his Republican Party in traditional votes and causes, sometimes defecting often in dramatic ways.

He will always be most remembered for suffering through years of imprisonment and torture in Vietnam after his jet was shot down over North Vietnam. The fact that he survived such neglect and abuse is a testament to his fortitude and the care other prisoners gave each other when there was no other available.

He was offered early release when his captors found that his father was an admiral but he refused the favor, insisting on following the protocol that prisoners would be released in the order they were captured.

He emerged disabled yet determined not to let what had happened to him end his career of public service, a career colored by what he had gone through.

Most could not have endured what he did, most have trouble imagining what it was like, yet from that experience emerged an unwavering dedication to fighting those in our country who would have us torture others in a misguided effort to extract information.

His 2008 run for the presidency provided vivid examples of the unpredictable nature of the man and his principles. His campaign entourage was known as the “Straight Talk Express” and the press loved covering him because you never knew what he was going to say but you knew it was going to make news. His choice of a running mate, Alaska Gov. Sarah Palin, was unpredictable and, in the end, unproductive. Her volatile and rambling speeches and interviews offered a preview of the presidential campaign and presidency of Donald Trump and the party he now heads often to the dismay of McCain.

But that campaign also offered an example of decency that showed the core of McCain’s principles. When a woman at a campaign appearance said she did not trust Barack Obama because he was “an Arab,” McCain could have let it go. Others at other rallies have said worse. But he politely corrected her.

“No, ma’am. He’s a decent family man, a citizen that I just happen to have disagreements with on fundamental issues.”

From the many moments in his very public life, from both highs and lows, that is the one that stands out today because it is so at odds with what we see in campaigns now.

Democrats and Republicans alike spent last weekend praising McCain, his courage, his achievements, his determination to survive against long odds and to continue fighting for what he believed in even as he faced certain death.

Now we watch and wait to see if those who praised him are able to follow his example.