A medic testifying in the trial of Navy SEAL Edward Gallagher -- who is accused of killing an injured ISIS prisoner of war in Iraq -- has shockingly testified Thursday that he is the one who killed the militant, not Gallagher.

The medic told a court at Naval Base San Diego that he killed the fighter by asphyxiation. He also testified that Gallagher stabbed the fighter, but did not kill him.

Gallagher, 40, has pleaded not guilty to premeditated murder and aggravated assault charges stemming from the alleged killing of a wounded ISIS fighter and alleged instances of firing sniper rounds at civilians in Iraq.

Gallagher was undergoing a medical screening at Camp Pendleton and was in the process of transitioning to a non-combat advisory role for the Navy SEALs when he was taken into custody in September 2018, his brother Sean said. Gallagher had planned to retire in the spring.

Throughout his 19 years of service, Gallagher earned the Bronze Star with V for Valor twice, a Meritorious Unit commendation and a trio of Navy and Marine Corps Achievement medals, among other recognitions and decorations.

He fought in Iraq and Afghanistan several times, reaching the status of what Sean Gallagher described as a "modern-day war hero."

It was during Gallagher’s final combat deployment, in 2017, that he's alleged to have committed war crimes. The Naval Criminal Investigative Service launched an investigation into Gallagher in April 2018.

Investigators previously have alleged that, while a teen ISIS fighter was receiving medical treatment from SEAL medics, Gallagher walked up and stabbed him in his neck and side with a knife, killing the terrorist. Then, they say, he posed for photographs with the fighter’s body, holding his head in one hand and his blade in the other.