At the first trial in Germany for war crimes committed in Syria's five-year-old war, Aria Ladjedvardi, 21, told the court he "didn't want to be in" the incriminating pictures, and that he "could not imagine that they would be circulated on social media".
Prosecutors have accused Ladjedvardi of a war crime as he had treated the unidentified victims "in a degrading and humiliating manner".
The photographs in which Ladjedvardi appears were taken in the spring of 2014 and posted on Facebook. Federal prosecutors believe he and two fellow fighters took the pictures to belittle their victims, whom they considered infidels or non-believers.
They also believe that Ladjedvardin, a German of Iranian origin, travelled to Syria in early 2014 to join one of the jihadist groups engaged in the fight against President Bashar al-Assad's regime.
But Ladjedvardi, who risks at least one year in prison, contested the claims at the opening of his trial in Frankfurt, arguing that he was in Syria to help victims of Assad's regime.
'Not a jihadist'
According to Ladjedvardi, villagers in the province of Idlib were alerted to the gruesome scene of the severed heads by a child.
A crowd swiftly gathered around the macabre sight, and several people began posing for photos, he said.
Ladjevardi, who was the only foreigner in the group, said he was then forced to pose for a picture too.
"We were in a war zone... I did what I was required to do in the situation," he told the court, speaking rapidly and with nervous gestures.
Ladjevardi then justified his trip to Syria, saying "I wanted to help the people".
Although he said he had become more religious before his departure for Syria, Ladjedvardi denied being part of any jihadist groups.
Instead, Islam and sports helped him turn around his life, he said, after a youth marred by alcohol and cannabis abuse as well as delinquency.
Through Facebook, he contacted an acquaintance who had left for Syria and subsequently helped Ladjevardi in his journey there.
He admitted that he was given training in weapons usage, but insisted he was not part of any jihadist group and had no contact with jihadists throughout his trip to Syria.
The prosecution has been unable to determine which group trained the accused in weapons handling. Neither was it able to establish the identities of the beheaded victims and on which side of Syria's warring parties they belonged.
Ladjevardi was arrested in October 2015 in the Frankfurt region, after police raided his apartment. He has been in custody ever since.
German federal prosecutors are currently investigating 10 cases of alleged atrocities in Syria or Iraq, along with more than 30 cases of suspected membership of a terrorist group involving jihadists returning from the Middle East.
The investigations have gained momentum with the arrival last year of over a million asylum seekers, about 40 percent of whom fled the wars in Syria and Iraq.
Authorities dealing with their asylum requests have picked up and forwarded on average 25 to 30 tip-offs a day to prosecutors, in line with a German requirement that asylum applicants provide information on any war crimes they may have witnessed.