President Trump on Wednesday directed the Navy to rescind medals that had been awarded to the lawyers who prosecuted Edward "Eddie" Gallagher, just weeks after a jury in San Diego found the Navy SEAL not guilty on six of seven charges for his connection to the killing of a teenage Islamic State member in Iraq.

“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,” Trump tweeted. “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.”

The president added: “I have directed the Secretary of the Navy Richard Spencer & Chief of Naval Operations John Richardson to immediately withdraw and rescind the awards.”

Navy officials, speaking on condition of anonymity because they were not authorized to publicly discuss the case, said the Navy secretary is authorized to pull such awards and would be doing so.

Three lieutenants -- George O. Hageman, Brian P. John and Scott I. McDonald -- and a female officer whose name and rank were redacted by the Navy received Navy Achievement Medals just eight days after Gallagher was found not guilty on all but one charge.

Gallagher was accused of stabbing to death a 15-year-old ISIS fighter in 2017 and posing with the corpse for photos.

NAVY SEAL ACCUSED OF KILLING ISIS DETAINEE WAS VICTIM OF 'TARGET FIXATION,' ATTORNEY SAYS IN CLOSING ARGUMENTS

He faced seven criminal charges in all. Six of the most serious charges included premeditated murder, willfully discharging a firearm to endanger human life, retaliation against members of his platoon for reporting his alleged actions, obstruction of justice and the attempted murders of two noncombatants. On all of those charges, the jury in San Diego found him not guilty.

Jurors did find him guilty of the seventh charge, posing for a photo with a casualty, considered the least egregious of the crimes, which carries a maximum prison sentence of four months.

CLICK HERE FOR THE FOX NEWS APP

Gallagher served nine months in prison awaiting trial but was released ahead of trial proceedings at the end of May as the judge attempted to rectify alleged prosecutorial misconduct which included the unauthorized tracking of the defense's emails.

Perhaps the biggest bombshell in the case occurred on June 20 when Gallagher's colleague, Special Operator 1st Class Corey Scott, admitted to asphyxiating the ISIS fighter back in 2017, contrary to the testimony of at least seven other SEALs who said Gallagher stabbed the ISIS fighter after medics administered treatment to him, ultimately resulting in the teenager's death.

Fox News' Vandana Rambaran and Greg Norman and The Associated Press contributed to this report.