(The June 20 story adds dropped first name and title of defendant in second paragraph.)

SAN DIEGO (Reuters) - A Navy SEAL medic testified on Thursday that he was responsible for the death of an Islamic State fighter - not the Navy SEAL defendant undergoing a court martial for war crimes - describing it as a mercy killing.

Special Operator 1st Class Corey Scott, a SEAL team medic, said under cross-examination by the defense in a courtroom at the San Diego Naval Base that he killed the fighter by asphyxiation, after he saw Special Operations Chief Edward Gallagher stab the victim with a knife.

Scott said he held his thumb over a breathing tube that had been inserted into the mouth of a fighter, who had a leg wound and collapsed lung following house-to-house fighting in the Iraqi city of Mosul in 2017.

The fighter had been captured by Iraqi forces and dumped on the ground at a base outside Mosul, the prosecution said in its opening statement on Monday.

Prosecutors say Gallagher, 39, who began his 18-year career as a medic, briefly treated the young Islamic State fighter, then pulled out his knife and stabbed him in the neck several times.

Scott, who was called to the stand by the defense, said the fighter was breathing normally after he and Gallagher treated him for wounds suffered in an air strike, but then saw Gallagher stab the young militant once with his knife.

Scott said the fighter survived the stabbing. But Scott said he blocked the young man’s air tube thinking he would eventually be tortured to death by Iraqi forces.

Scott’s testimony under immunity from prosecution appeared to take the prosecutors by surprise and stunned the courtroom, witnesses said.

FILE PHOTO: U.S. Navy SEAL Special Operations Chief Edward Gallagher leaves court after the first day of jury selection at the court-martial trial at Naval Base San Diego in San Diego, California , U.S., June 17, 2019. REUTERS/Mike Blake

The judge denied an immediate defense motion to dismiss the case.

MURDER OR MUTINY?

The seven-sailor jury at the court martial must decide whether the fighter’s death was murder as alleged by the prosecution or a mutiny by sailors under Gallagher’s command in Iraq, as the defense contends.

Gallagher could face life in prison if convicted in the trial arising from his 2017 deployment to Mosul, Iraq.

Defense attorney Tim Parlatore said the surprising admission from Scott that he had asphyxiated the wounded fighter showed that the prosecution never asked about the cause of death and the Navy Criminal Investigation service had gone into the case with minds made up.

“From the moment NCIS got involved, they ignored everything that didn’t fit their case,” Parlatore said. “What we learned today is Chief Gallagher is not guilty of murder.”

Gallagher’ wife, Andrea, told reporters after Thursday’s court session ended: “We’ve been patiently waiting for the truth to come out. It’s been lies, half-truths and cover ups till now.”

Prosecutors were not available for comment.

Gallagher is also charged with attempted murder in the wounding of two civilians - a schoolgirl and an elderly man - shot from a sniper’s perch in Iraq.

He maintains fellow SEAL team members in his platoon, who turned him in and are testifying against him under grants of immunity, are disgruntled subordinates who fabricated allegations to force him from command.

The court martial has drawn national attention - including that of President Donald Trump who said last month that he is considering pardons for a number of military service members accused of war crimes, and Gallagher’s case was believed to be one of those under review.

Gallagher, a career Navy officer, was on his eighth deployment, this time to Iraq where SEALs were training Iraqi military as they pushed Islamic State fighters out of Mosul in a fight that went block by block through the war-ravaged city.

Iraqi forces came across the Islamic State fighter after he had been shot in the leg and was struggling to breathe during the fighting in Mosul. They tied him to the hood of a Humvee before driving two hours to their operating base, where he was placed on the ground and died 20 minutes later.