SAN DIEGO (AP) — A military jury acquitted a decorated Navy SEAL of premeditated murder Tuesday in the killing of a wounded Islamic State captive under his care in Iraq in 2017.

Special Operations Chief Edward Gallagher was cleared of all charges except for posing for photos with the dead body of the captive in a verdict that is a major blow to military prosecutors. It took the jury less than two days of deliberations to reach its verdict.

Gallagher reacted with "tears of joy, emotion, freedom and absolute euphoria," defense lawyer Marc Mukasey said.

"Suffice it to say this is a huge victory," Mukasey said outside court. "It's a huge weight off the Gallaghers."

Defense lawyers said Gallagher was framed by disgruntled platoon members who fabricated the allegations to oust their chief. They said there was no physical evidence to support the allegations.

The prosecution said Gallagher's own text messages and photos incriminated him. They included photos of Gallagher holding the dead militant up by the hair and clutching a knife in his other hand.

A text message Gallagher sent while deployed said "got him with my hunting knife."

The prosecution asserted the proof of Gallagher's guilt was in his own words, his own photos and the testimony of his fellow troops, while defense lawyers called the case a "mutiny" by entitled, junior SEALs trying to oust a demanding chief and repeatedly told the jury that there was no body, no forensic evidence and no blood found on the knife.

The case gave a rare public view of a deep division in the insular and revered SEAL community. Both sides told jurors that witnesses had lied on the stand and it was their duty to push through the evidence to find the truth. Gallagher, 40, did not take the stand.

The panel of five Marines and two sailors, including a SEAL, had to weigh whether Gallagher, a 19-year veteran on his eighth deployment, went off the rails and fatally stabbed the war prisoner on May 3, 2017, as a kind of trophy kill, or was the victim of allegations fabricated after the platoon returned to San Diego to stop him from getting a Silver Star and being promoted.

Under the military system, two-thirds of a jury needs to agree to convict. In Gallagher's case, that meant five of seven jurors. Military juries also have the option to convict on lesser charges, such as attempted murder.

It's not known whether any of Gallagher's jurors voted for a conviction on the most serious charges; vote tallies are not made public in military cases.

Gallagher was also charged with attempted murder in the shootings of two Iraqi civilians, and four other charges that include the unlawful discharge of his firearm by shooting at noncombatants, wrongfully posing with a human casualty, impeding an investigation by discouraging platoon members from reporting his criminal actions and retaliating against those who did.

The two-week trial included the testimonies of nearly a dozen SEALs, including Special Operator Corey Scott, a medic like Gallagher, who told the court that he saw the chief stab the Islamic State militant in the neck but stunned the court when he said he was the one who ultimately killed the prisoner by plugging his breathing tube with his thumb as an act of mercy.

Seven SEALs said Gallagher unexpectedly stabbed the captive moments after he and the other SEAL medics treated the detainee who was wounded in an airstrike that morning outside Mosul. Two, including Scott, testified they saw Gallagher plunge his knife into the prisoner's neck.

During the trial, it was revealed that nearly all the platoon members readily posed for photos with the dead prisoner and watched as Gallagher read his reenlistment oath near the body in an impromptu ceremony.

Defense lawyers called the pictures of Gallagher, a Bronze Star recipient, clutching the corpse's hair and his texts about his knife skills just the dark humor of a warrior.

An Iraqi general who handed the wounded prisoner to the SEALs testified that Gallagher did not stab the boy. And Marine Staff Sgt. Giorgio Kirylo said after the militant died that he moved the body to take a "cool guy trophy" photo with it and saw no stab wounds on his neck.

Gallagher's attorneys said there were a number of things that could have caused the militant's death, including internal injuries from the blast.

Most of the witnesses were granted immunity to protect them from being prosecuted for acts they described on the stand.

Lt. Jacob Portier, the officer in charge, has been charged separately for overseeing the reenlistment ceremony and not reporting the alleged stabbing.

The trial followed months of turmoil in one of the Navy's most prominent war cases, including the removal of the Navy's lead prosecutor after it was discovered the prosecution had tracked the emails of the defense team to find a news leak. The judge in response to that lowered the maximum sentence Gallagher could face for premeditated murder to life in prison with parole, instead of without parole.

Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.