Navy Special Operations Chief Edward Gallagher walks out of military court during lunch recess on July 2, 2019 in San Diego, California. Sandy Huffaker/Getty Images

The war-crimes case of a Navy SEAL has left President Donald Trump in a fraught relationship with the Pentagon, according to a new report by The New York Times.

Chief Petty Officer Edward Gallagher has been at the center of a two-year case that began with his September 2018 arrest over allegations he used a knife to execute a wounded teenage Islamic State fighter in military custody and shot civilians while deployed to the Iraqi city of Mosul in early 2017.

Despite the gory allegations, which Gallagher has denied, Trump intervened several times to fully back Gallagher against legal consequences and retribution from the Navy. A military jury acquitted Gallagher of all charges against him except one related to his taking a photo with the dead ISIS fighter.

Trump’s meddling is said to have left lasting concerns within the Pentagon over his leadership.

Visit Business Insider’s home page for more stories.

The war-crimes case of a Navy SEAL has left President Donald Trump in a fraught relationship with the Pentagon as some feel he overstepped his bounds by meddling in the case, according to a new report by The New York Times.

Chief Petty Officer Edward Gallagher has been at the center of a two-year case that began with his September 2018 arrest over allegations he used a knife to execute a wounded teenage Islamic State fighter in military custody and shot civilians while deployed to the Iraqi city of Mosul in early 2017.

Six fellow SEALs reported Gallagher before he was arrested, and several went on to provide shocking allegations about Gallagher’s behavior while deployed. Prosecutors also alleged he wrongfully took the opioid Tramadol and warned fellow SEALs against detailing his actions in Iraq to investigators.

In addition to the charges laid out in 2018, however, The Times described several alarming communications by Gallagher in which he sought out the bloodiest possible opportunities.

„We don’t care about living conditions,“ he reportedly texted a SEAL master chief who was making assignments. „We just want to kill as many people as possible.“

The Times reported that Gallagher commissioned a custom hunting knife and a hatchet from a friend and wrote in a text that he would „try and dig that knife or hatchet on someone’s skull!“

Several SEALs have testified that Lt. Jacob Portier, the officer in charge, gathered the platoon for „trophy photos“ with the corpse of the ISIS captive before holding a reenlistment ceremony for Gallagher over the body.

He later texted a friend a photo of himself holding the captive by the hair alongside his hunting knife, adding there was a „good story behind this, got him with my hunting knife.“

The Times reported that by the end of Gallagher’s deployment, some SEALs had taken to privately calling him „el diablo,“ or the devil.

Trump faced off against the Navy with support from Fox News

FILE – In this July 25, 2019, file photo, President Donald Trump reviews the troops during a full honors welcoming ceremony for Secretary of Defense Mark Esper at the Pentagon in Washington. If there was one day that crystallized all the forces that led to the impeachment investigation of President Donald Trump, it was July 25. That was the day of his phone call with Ukraine’s new leader, pressing him for a political favor. (AP Photo/Alex Brandon, File) Associated Press

Gallagher denied all the allegations and was acquitted by a military jury of all charges except one for taking pictures with the ISIS fighter’s corpse.

Throughout the process, Trump intervened several times in the case to fully back Gallagher against legal consequences and retribution from the Navy, sometimes in accordance with conservative media figures and Republican lawmakers who railed against the process by which officers examined Gallagher.

Trump ordered Gallagher to be moved to less restrictive confinement while awaiting trial and stripped prosecutors of the Navy Achievement Medals they received for their work on Gallagher’s case. Trump eventually said he would grant Gallagher clemency and ensure his rank be restored.

Richard Spencer, who was ousted as Navy secretary over Gallagher’s case, wrote in The Washington Post on Wednesday that Trump was conducting „a shocking and unprecedented intervention in a low-level review.“

„It was also 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,“ Spencer wrote.

Chris Shumake, a former sniper who served in Gallagher’s platoon, told The Times that Trump’s meddling had cast a bad shadow across the SEAL teams.

„It’s blown up bigger than any of us could have ever expected, and turned into a national clown show that put a bad light on the teams,“ Shumake told The Times. „He’s trying to show he has the troops‘ backs, but he’s saying he doesn’t trust any of the troops or their leaders to make the right decisions.“

The Times noted that Trump’s unwavering support for Gallagher had been notably apparent in conservative media, particularly the „Fox & Friends“ weekend host Pete Hegseth, who loudly defended Gallagher.

„These are men who went into the most dangerous places on earth with a job to defend us and made tough calls on a moment’s notice,“ Hegseth said in May. „They’re not war criminals, they’re warriors, who have now been accused of certain things that are under review.“