A US Navy SEAL was acquitted of murdering a captive teenage fighter in Iraq on late Tuesday.

Edward Gallagher, 40, was found not guilty of two counts of attempted murder against Iraqi civilians but was convicted of posing for a photograph beside the corpse of the captive Islamic State (IS) group fighter.

The charges stemmed from allegations by men under his own command in the special operations branch of the US Navy.

Gallagher’s case proved divisive in the US where he is viewed as a war hero by some.

Timothy Parlatore, Gallagher lawyer’s said, “The jury found Gallagher “not guilty of murder, not guilty of stabbing, not guilty of shooting, not guilty of all those things, they found him guilty of taking a photograph.”

Gallagher was also charged with attempted murder in the wounding of two unarmed civilians – a schoolgirl and an elderly man – shot from a sniper’s perch, as well as with firing deliberately on other non-combatants and with obstruction of justice.

Corey Scott, a first-class petty officer, who was given immunity from prosecution, acknowledged during questioning that he made the revelation to spare Gallagher, who is married and has children, from going to prison.

US President Donald Trump had also expressed his concern over the prosecution of US soldiers accused of war crimes, with Gallagher reportedly among those he was considering granting pardons in May.