WASHINGTON — President Trump intervened Tuesday once again on behalf of a Navy SEAL who was charged but acquitted of war crimes in the death of a captured Islamic State fighter in Iraq, ordering the military to punish the prosecutors who tried the case in the first place.

Mr. Trump angrily lashed out at the Navy for awarding commendations to prosecutors in the murder trial of Edward Gallagher, a former special operations chief, and he publicly instructed Pentagon officials to strip them of the medals. His announcement was a remarkable rebuke by a president of his own Navy leadership.

“The Prosecutors who lost the case against SEAL Eddie Gallagher (who I released from solitary confinement so he could fight his case properly), were ridiculously given a Navy Achievement Medal,” Mr. Trump wrote on Twitter. “Not only did they lose the case, they had difficulty with respect to information that may have been obtained from opposing lawyers and for giving immunity in a totally incompetent fashion.”