National security adviser Robert C. O’Brien on Sunday defended President Trump’s decision to roll back disciplinary action against Chief Petty Officer Edward Gallagher, the disgraced Navy SEAL who was accused of war crimes for allegedly killing an Iraqi teenager and later posing with the corpse for a photograph.

In an interview on ABC News’s “This Week,” O’Brien contended that there were “very serious legal issues” with the pretrial portion of Gallagher’s legal proceedings, echoing the arguments made by Trump and others in defense of Gallagher.

“Ultimately, the president as commander in chief has said that he’s got the back of our men and women in uniform,” O’Brien said. “He has the power to pardon and to grant clemency. He exercised that power here. … This is a case that deserved clemency.”

President Trump courted controversy pardoning two Army officers accused of war crimes and restoring the rank of a demoted Navy SEAL commander on Nov. 15. (Reuters)

Trump’s embrace of Gallagher got messier Friday after the New York Times published video testimony showing men who had worked under him describing their former chief as “evil,” “toxic” and an unrepentant killer.

“I saw Eddie take a shot at probably a 12-year-old kid,” one of the SEALs says in the video testimony.

Asked Sunday whether he finds those comments troubling, O’Brien did not directly respond.

“Look, it’s very troubling that we send folks out that have to make split-second decisions dealing with terrorists, dealing with bombmakers, in very, very, difficult decisions overseas,” he said. “And what the president has said is we’re going to stand behind our warriors.”

O’Brien added that the testimony published by the New York Times represents “a selective group of SEALs” and that there “were also many, many SEALs and many folks in the special warfare community that support Chief Gallagher, that appealed to the president and asked him for this clemency.”

Trump intervened several times during Gallagher’s prosecution, and when a military court in July acquitted the chief petty officer of the majority of war-crimes charges he faced, the president tweeted that he was glad to have been able to help.

Gallagher was convicted of the lesser charge of posing with the body, but Trump ensured that he would not be demoted or stripped of his status as a Navy SEAL, overruling military leadership. Navy Secretary Richard V. Spencer was later fired after Defense Secretary Mark T. Esper took issue with his handling of Gallagher’s case.

When asked about Spencer’s ouster in late November, Trump said he had to “protect my warfighters” and called Gallagher “one of the ultimate fighters” and a “tough guy.”

Earlier this week, Gallagher socialized with Trump and his inner circle at the president’s Mar-a-Lago estate, suggesting he could become a fixture in Trump’s orbit during the 2020 campaign.

Gallagher and his wife, Andrea, posted several photos on their joint Instagram account of their West Palm Beach, Fla., visit.

One photo shows the couple at a conservative student summit where Trump spoke, posing with a group that included Donald Trump Jr., the president’s eldest son.

Another shows them around a dinner table with Eric Trump, another son of the president, and Rudolph W. Giuliani, the president’s personal attorney.

And the couple posted eight candid photos of them chatting with the president and first lady at Mar-a-Lago, along with a caption declaring that they had finally been able to give Trump a thank-you gift from Mosul, Iraq.

Missy Ryan contributed to this report.

Correction: An earlier version of this report incorrectly stated that Gallagher faced no punishment for his crime and that Spencer had been fired by Trump. This version has been corrected.