It was a small but necessary moment in a wild campaign.

Sen. John McCain was running for president in 2008 against Sen. Barack Obama when a McCain supporter at a rally, in Lakeview, Minnesota, said he “frankly” was “scared of an Obama presidency.”

McCain grimaced.

“First of all, I want to be president of the United States and obviously I do not want Senator Obama to be,” McCain said. “But I have to tell you, I have to tell you, he’s a decent person, and a person that you do not have to be scared of as president of the United States.”

EDITORIAL

The crowd booed. This was not what they wanted to hear. This was not what McCain’s running mate, Sarah Palin, would have said. It certainly wasn’t what Donald Trump might have said eight years later.

Another McCain supporter at the rally then said, “I don’t trust Obama. . . . He’s an Arab.”

McCain shook his head. He looked pained.

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

McCain died from brain cancer on Saturday after living a full, complicated and remarkable life. When you examine his life story, it’s easy to understand why he fended off those boos from the crowd in Minnesota.

RELATED:

John McCain remembered as free thinker, never to be intimidated
John McCain, senator, war hero and presidential candidate, dies at 81
Celebrities, notables react to passing of John McCain
Politics aside, reactions pour in about John McCain: ‘We are all in his debt’

As the son and grandson of four-star admirals, he could have pulled easy duty in Vietnam, but he volunteered for dangerous bombing runs. After being shot out of the sky, he was tortured for five years as a prisoner of war, but refused to be released until his fellow prisoners also were freed.

As a Republican senator, he was the celebrated “maverick” who challenged his party’s orthodoxy. He  opposed a constitutional amendment to ban same-sex marriage, demanded a ban on the use of torture, took the threat of global warming seriously, pushed through campaign finance reform, and even opposed efforts to repeal Obamacare.

McCain was not always consistent, and his famous “straight talk” could curve. But one of his great charms was a willingness to look back on his past actions, such as choosing Palin to be his vice presidential pick, and admit when he was wrong.

McCain was a profile in courage in many ways, including the dignified manner in which he met his death.

It feels a little odd to us, then, that as we consider this good man’s life, we keep thinking about that rally in Minnesota. All the senator really said that day was what any decent person could and should have said — that honorable people can disagree without trashing each other.

But, of course, we don’t see enough of that much anymore, certainly not from our president or his ilk. Instead, we have an attorney general, Jeff Sessions, who when facing a crowd chanting “lock her up” — meaning Hillary Clinton — laughed and said “lock her up.”

McCain could not stand all that, which is why Trump could not stand him.

McCain was an ambitious man, eager to prove himself the measure of his father and grandfather. To get to where he wanted to go, he was willing to tack. Beneath it all, though — especially in his last ten years — he knew what mattered most.

Country before ambition. Country before party.

That made McCain an equal opportunity troublemaker. Democrats were beside themselves last year, of course, when the senator left his sick bed to vote to proceed on repealing Obamacare. Republicans were more furious three days later when he voted against a weakling replacement for Obamacare — the so-called “skinny” bill.

His “no” vote killed the entire repeal effort.

“I’ve stated time and time again that one of the major failures of Obamacare was that it was rammed through Congress by Democrats on a strict party-line basis without a single Republican vote,” McCain said after the vote. “We must now return to the correct way of legislating and send the bill back to committee, hold hearings, receive input from both sides of aisle, heed the recommendations of nation’s governors, and produce a bill that finally delivers affordable health care for the American people.”

So said John McCain. An American patriot. The maverick. The real thing.

Send letters to: letters@suntimes.com.