The president was visibly moved as he spoke.

“We thank you for your service,” he said on Thanksgiving Day to America’s soldiers. “We’re proud of you, and America stands solidly behind you. Together, you and I have taken an oath to defend your country. You’re honoring that oath.”

This wasn’t President Donald Trump talking on Thursday, of course. That was President George W. Bush, speaking to a gathering of troops on Thanksgiving Day in 2003, on a surprise visit to a sandbagged bunker in Iraq.

EDITORIAL

What Trump actually said on Thursday amounted to naked political gas-bagging:

“That’s why we’re doing a strong border,” he said in a phone call to a brigadier general in Afghanistan. “Large numbers of people, in many cases we have no idea who they are, and in many cases they are not good people. They are bad people.”

Then again, there were these words of heartfelt thanks:

“I can’t tell you how impressed I am by the courage and compassion of our troops. … Calling you is the least I can do because I admire the military so much.”

But, as you’ve guessed, that wasn’t Trump, either. That was Bush again, this time talking by phone to soldiers in Iraq on Thanksgiving Day in 2007.

Trump, for his part, barely managed on Thursday to squeeze in a thank you. He drifted instead from beating up on immigrants to beating up on judges:

“There have been a lot of very bad court decisions, from the Ninth Circuit, which has become a big thorn in our side, always lose, and you lose again and again, and you hopefully win at the Supreme Court,” the president said in his call from his golf club, Mar-a-Lago, while waiters set tables for dinner in the background. “But it’s a terrible thing when judges take over your protective services, when they tell you how to protect your border. It’s a disgrace.”

OK. Small confession. Just typing that quote was demoralizing.

But this one should cheer us all up:

“If you strip it all away, the number one problem in this old world today is the problem of Bosnia, the problem of Kosovo: It’s racial and ethnic and religious hatred and dehumanization. All you’ve got to do is look around the room today, and you see that our military is a stunning rebuke of that. This is the American idea in flesh and blood, all of you. You come from all different backgrounds, all different races, all different religious faiths, all different walks of life. And you’re here working together as a team.”

Those thoughtful words, so opposite in spirit to Trump’s self-serving pettiness, were spoken by President Bill Clinton when he visited with American troops in Bosnia shortly before Thanksgiving in 1996. His daughter, Chelsea, came along and helped serve the turkey and mashed potatoes.

We could go on, but our point is made: Every American president sends a special message to our nation’s armed service members on or close to Thanksgiving Day. They do so publicly and sometimes, as in the case of Barack Obama, also privately, spending hours talking quietly with individual soldiers.

And always, without exception, they keep the partisan politics to a minimum while expressing a nation’s deep gratitude.

Until this president.

Once again, Trump showed himself incapable of empathy. Once again, it was all about himself.

Once again, he was an object lesson for our children: This is the kind of person we do not want you to grow up to be.

American troops — some 170,000 active-duty personnel — are serving our nation in 150 foreign countries. They were far from home on this Thanksgiving, and we hope they know how dearly they were missed.

Their families prayed for them. Their friends toasted them. Their fellow Americans held them in their hearts.

We thank them, just as we thank America’s 1.3 million active service members, at home and abroad.

We thank them for standing guard.

Well, hell, somebody had to say it.

Send letters to: letters@suntimes.com.