On Thursday night, a besuited Donald Trump appeared at a US airbase in Afghanistan, serving Thanksgiving turkey to the troops, complaining half-jokingly about the length of his surprise trip, and drawing attention to all the money he had spent on the military.

Trump heads to UK for Nato summit as impeachment deadline looms – live Read more

“You’ll come back,” the president told soldiers at the Bagram base – a remark interpreted by the reporters covering the event as a reference to the quality of the food he was giving them, rather than warning of further tours of duty in a war that is already 18 years old.

Trump left Afghanistan three and half hours after he arrived and flew back to his Florida resort of Mar-a-Lago, leaving behind conflicting clues about his intentions. He restated his frequent promise that he would bring the troops home, but also insisted: “We don’t play for ties,” adding: “We’re going to stay until such time as we have a deal or we have total victory.”

A true warrior is one who who exercises restraint Rachel VanLandingham, retired air force lieutenant colonel

Distributing hot dinners to soldiers is a standard requisite for being commander-in-chief, though it is one that Trump has largely managed to avoid. After nearly three years in office, it was his first visit to Afghanistan and only his second trip in the vicinity of a war zone. But with the presidential election now less than a year away, and the grey cloud of impeachment hanging over the White House, he is cloaking himself as tightly as he can in khaki.

Over the past few months, Trump has embraced his role as commander-in-chief, announcing unheralded military movements in and out of Syria and intervening repeatedly in the military justice system to absolve service soldiers accused of war crimes.

The US military – or its leadership at least – is hardly reveling in the president’s attention. A spate of reports cite former commanders and unnamed active duty senior officers complaining about the undermining of the chain of command and the corrosion of the integrity of an institution most Americans have seen as a pillar of the republic – an incorruptible and disciplined armed forces.

CNN reported “at least two senior military officers” had been reluctant to appear alongside Trump at recent official events, out of fear of he would come out with partisan remarks.

Richard Spencer, the secretary of the navy fired last week after clashing with the president over war crimes cases, wrote in the Washington Post that it was “a reminder that the president has very little understanding of what it means to be in the military, to fight ethically or to be governed by a uniform set of rules and practices”.

It is a far cry from the early days of Trump’s presidency, when he surrounded himself with military brass and boasted about “his generals”. One by one those grand martial figures have left the administration, to be lampooned by their commander-in-chief on their way out the door as “failed generals” who were “not tough enough” and “overrated”. More senior officers are reported to be considering resignation, if the president continues to meddle in what they see as the preserve of the military.

But Trump is unlikely to stop.

The president has held up war crimes defendants as “warriors”, betrayed by their politically correct superiors. “We train our boys to be killing machines, then prosecute them when they kill!” he complained in a tweet.

“That represents a fundamental misunderstanding of the American warrior ethic,” said Rachel VanLandingham, a retired air force lieutenant colonel and a professor at Southwestern Law School in Los Angeles. “A true warrior is one who who exercises restraint and it requires moral courage to exercise restraint.”

Facebook Twitter Pinterest The former US navy secretary Richard Spencer. Photograph: Michael Reynolds/EPA

But Trump’s ideal is encouraged by the pundits he watches on Fox News. He has granted pardons in similar cases earlier in the year, and he clearly believes it fires up his base. The Daily Beast reported he was planning to hit the campaign trail with the three soldiers he recently absolved of war crimes charges.

The trio includes the former army lieutenant Clint Lorance, sentenced to 19 years in prison for murder after ordering his men to open fire on three unarmed Afghan men riding past on a motorcycle, killing two of them. And the Green Beret major Matthew Golsteyn, who was facing murder charges after admitting to CIA interviewers that he had killed an unarmed detainee, a suspected bomb-maker, and burned the corpse while serving in Afghanistan in 2010. Trump pardoned both two weeks ago.

He also intervened repeatedly in the case of the Navy Seal chief Edward Gallagher, who had been acquitted of the murder of an unarmed detainee, but demoted after being found guilty of posing for a “trophy” photograph with the corpse.

Trump went on Twitter to insist Gallagher keep his trident pin, the celebrated badge of the elite unit, in defiance of a Navy Seal review board.

The defendant’s lawyers had found a way of working around the military justice system by getting their cases a sympathetic hearing on Fox, knowing it has an avid viewer in the White House.

Their cases were championed in particular by Pete Hegseth, a weekend chat show host on Fox & Friends who is a former reserve military officer, with a dedicated following in the ranks of the armed forces.

Hegseth has been scathing over the senior officers who criticize Trump.

Gallagher appeared on Hegseth’s show last Sunday, and shocked the military hierarchy by trashing his superiors while still on active duty. He accused Spencer of meddling and the navy special war commander of insubordination for resisting Trump’s interference in military justice.

“There will be subset of the military who will see this as his way of taking on the system, and protecting this guy,” said Katrina Mulligan, who served in the Obama administration’s national security council and justice department and is now managing director for national security and international policy at the Center for American Progress.

Fired navy secretary blasts Trump over 'shocking' handling of Navy seal case Read more

“Most people in the military and other national security institutions will find it deeply upsetting. You don’t grow up in military service without a healthy respect for the way military justice operates,” she added.

The war crimes meddling is just one point of friction between the commander-in-chief and the military.

Trump – who never served in the military, and avoided Vietnam by claiming to have “bone spurs” – has claimed greater expertise than his commanders, and has fired off orders on Twitter with little or no consultation. In early October, he ordered all US troops out of Syria, having been persuaded to take that course of action by Turkish president, Recep Tayyip Erdoğan, only to command his forces back in little more than two weeks later, to “secure the oil”.

He diverted nearly $13bn in military construction projects and thousands of troops to help build his long-promised wall on the southern border. He abruptly cut off year-long negotiations with the Taliban in September, but declared them back on during his Thanksgiving visit to Afghanistan. There was no apparent shift in underlying circumstances in either case.

Trump is fond of talking about “my military”, but the claim is less true with every passing month. Veterans still support him in significantly greater numbers than the general population, but he no longer has a lead among active duty service members, who are fairly evenly split between approval and disapproval.

The damage done to the fabric of the military, by the divisions and uncertainty stirred up by the commander-in-chief, is harder to calculate.

“By intervening, Trump is creating circumstances where the men and women in uniform are being asked to take sides between the superior officers and the president,” Mulligan said. “It makes you wonder: is nothing sacred? Sadly, the answer is no.”