SAN DIEGO — It was a bombshell testimony in court Thursday when a Navy SEAL called by prosecutors to testify at the murder trial of a colleague has acknowledged killing a wounded prisoner in Iraq in what he described as an act of mercy.

Special Operator 1st Class Corey Scott said Thursday that he asphyxiated the teenage Islamic State fighter after Special Operations Chief Edward Gallagher unexpectedly stabbed him.

Special Operator 1st Class Corey Scott said Thursday that he asphyxiated the teenage Islamic State fighter after Special Operations Chief Edward Gallagher unexpectedly stabbed him.

Gallagher is facing court-martial on charges of murder and attempted murder.

RELATED: Witness at Navy SEAL trial: I killed victim out of mercy

Scott says the militant had been stabilized and was breathing normally after he and Gallagher treated him for wounds suffered in an airstrike.

Scott says the patient would have survived the stabbing, but he decided to plug the youth's air tube because he believed he would eventually be tortured by Iraqi forces.

A prosecutor says Scott never revealed that version of events in previous conversations and accused him of lying to help Gallagher.

Longtime military attorney Jeffrey Carver said, “the fact that this witness changed or appears to have changed his story supports the defense theory.”

“Just because somebody comes forward and says look, ‘I did it,’ Perry Mason style, right, ‘he’s innocent, I’m guilty,’ case closed go to commercial – it does not work that way.”

Gallagher’s attorney Tim Parlatore was pleased with Thursday’s bombshell.

“The best offense for Chief Gallagher is the truth. Today, the truth started to come out,” said Parlatore.

Prosecutors were stunned and allege Scott lied after being granted immunity.