Spencer quit under pressure Sunday after Defense Secretary Mark Esper faulted him for a clumsy, underhanded attempt to finesse Trump’s demands that the Navy cancel a disciplinary proceeding for Chief Petty Officer Edward Gallagher, a SEAL who had been convicted of posing with the body of a deceased militant in Iraq. Trump had railed for days on Twitter about the Navy's treatment of Gallagher, whose trial on war-crimes charges had drawn support from many of the president's conservative backers.

Outgoing Secretary of the Navy Spencer’s acknowledgment-of-termination letter says that he “cannot in good conscience” obey an order he believes “violates the sacred oath“ he took & that he and POTUS disagree on the “key principle of good order and discipline” pic.twitter.com/EZ8YPM7M0L — Jake Tapper (@jaketapper) November 24, 2019

Yet the incident was just the latest collision between Trump and the Pentagon leaders, following incidents in which the president ignored or overruled their advice not to withdraw troops from Syria, ban transgender people from serving or redirect military forces and funding to the U.S.-Mexico border. Trump has also weighed in publicly on individual military procurement projects — such as criticizing a potential $10 billion Pentagon contract for Amazon, which Esper subsequently awarded to Microsoft — and demanded that the Navy switch back to old-fashioned steam catapults for its next generation of aircraft carriers.

His military leaders have also had to play cleanup on political flaps involving the president, including an episode in which the White House may have sought to conceal the name of the destroyer USS John S. McCain when Trump was visiting Japan last spring.

Spencer launched a fresh broadside against the president on Monday evening for intervening in the Gallagher case. "What message does that send to the troops? That you can get away with this," he told CBS. "We have to have good order and discipline. It is the backbone of what we do.

“I don’t think he really understands the full definition of a warfighter," he added, referring to Trump. "A warfighter is a profession of arms and a profession of arms has standards, that they have to be held to and they hold themselves to.”

Trump's commanders have found various ways to cope with his missives, which he's often delivered via tweet — most dramatically in the case of former Defense Secretary Jim Mattis, who resigned in December after the president ordered a total pullout from Syria. Now Pentagon-watchers are curious about the fate of Rear Adm. Collin Green, the commander of the Naval Special Warfare Command overseeing the elite SEALs, to see if he will follow Spencer out the door.

Like Spencer, Green had supported a planned disciplinary review that could have led to the Navy ousting Gallagher from the SEALs — a process that Esper canceled after Trump intervened.

Gallagher "will retire from active duty," according to Navy spokesperson Cmdr. Clay Doss. "We will not provide additional details due to privacy concerns."

Green, meanwhile, "remains focused on his job as the commander of Naval Special Warfare," WARCOM spokesperson Capt. Tamara Lawrence told POLITICO.

"I don’t know that Rear Admiral Green will be an effective SEAL commander" now, said Kelly Magsamen, a former assistant secretary of defense who is now at the Democratic-leaning Center for American Progress. "I am watching to see if he will resign.”

Another potential breaking point could involve the Army's upcoming decision on whether to restore the special-forces status of Maj. Mathew Golsteyn, whom Trump has pardoned of charges that he murdered a civilian in Afghanistan. The Army has not indicated which way it's leaning in that case.

Hours before he stepped down under pressure, Spencer acknowledged to POLITICO that Trump and his military leaders had disagreed on a host of issues in recent months — though he sought to tamp down the notion that the two sides were on a collision course.

Outgoing Navy Secretary Richard Spencer. | Alex Brandon/AP Photo

“At the end of the day he is the president,” Spencer said during an interview at last weekend’s Halifax International Security Forum in Nova Scotia. “He gets to make up his own mind.”

The next day, though, Spencer sounded a much different tone in a scorching resignation letter to Trump, writing that the two had reached a rupture over "the key principle of good order and discipline."

"I cannot in good conscience obey an order that I believe violates the sacred oath I took in the presence of my family, my flag and my faith to support and defend the Constitution of the United States," he wrote, appearing to refer to Trump's insistence that Gallagher remain a SEAL.

Trump defended his intervention in the cases of the elite troops, telling reporters Monday that he is protecting America's warriors against "very unfair" proceedings.

“There’s never been a president that’s going to stick up for them, and has, like I have,” Trump said in the Oval Office.

Esper on Monday took responsibility for the final decision to let Gallagher retain his SEAL's Trident pin, while hinting at the strain the Pentagon chief is under. "If folks want to criticize anyone at this point about reaching down into the administrative processes, then simply blame me," Esper told reporters. "I'm responsible at this point. It's not where I prefer to be, but I'll own it."

Trump's relationship with the Pentagon is a far cry from the early days of his administration, when military leaders credited him with giving his generals greater power to make decisions on their own authority, compared with the heavier-handed management of former President Barack Obama and his staff. That included allowing Mattis to take the White House out of the loop on moves such as launching operations against ISIS and al-Qaida targets in the Middle East.

But the president's meddling in military minutiae has been steadily on the rise — first at home, and more recently abroad.

“Under Obama, we’d bitch because it was this long, involved process. Now we bitch because Trump makes quick, unexpected decisions that aren’t well synchronized,” said a former senior military officer who served under Trump until earlier this year. “Now we’re back much more into the details where you wouldn’t necessarily expect that the president would have to step in.”

Retired Lt. Gen. Michael Nagata agreed that the frustrations are real.

“The president and his senior leaders just seem to have little regard for the feedback of the practitioners in the field," said Nagata, who helped oversee the war against the Islamic State in Iraq and Syria and recently stepped down as director of strategic plans at the National Counterterrorism Center.

“The president and his senior leaders just seem to have little regard for the feedback of the practitioners in the field." Retired Lt. Gen. Michael Nagata

In 2017 and 2018, missives from Trump sent the Pentagon spinning on one issue after another. Those included a promise to kick transgender personnel out of the military and an order to establish a Space Force, as well as Trump's demand for a military parade in Washington, D.C., and the deployment of thousands of active-duty troops to the U.S.-Mexico border ahead of the midterm elections.

He has repeatedly clashed with the generals over the number of troops in Syria, where he has overruled Pentagon leaders and commanders who have insisted that an abrupt pullout would empower ISIS. (American troops have remained in Syria, on what Trump describes as a mission to protect the oil.) In Afghanistan, he has threatened to abruptly withdraw despite the advice of the Joint Chiefs of Staff.

Now, some who have served in the chain of command fear the divide will widen after the Gallagher case.

“President Trump has always kept his own counsel and to some degree gone around the Department of Defense, but it’s escalating, and I expect it will continue to escalate, especially in light of political developments like the impeachment,” said former Republican Sen. Chuck Hagel, who served as secretary of defense under Obama. “My guess is that he will continue to tighten down his grip on the Pentagon as we’ve seen him do over the past year.”

Others said Trump's meddling in the Gallagher case may be only the beginning.

“How do you square an established process like a UCMJ proceeding or a Trident review board with decisions by emotion and direction by tweet?” said a senior defense official who was not authorized to speak publicly, referring to the Uniformed Code of Military Justice. “You’re trying to place traditional logic over things that can’t be made logical.”

Dave Brown contributed to this report.