STOCKHOLM (Reuters) - A Swedish court on Monday sentenced a Syrian asylum seeker to eight months in prison after he posed for photos with dead bodies during the conflict in his home country.

The man admitted to posing with dead or severely injured people while fighting for the Syrian army in 2014 and that he knew the pictures would be used for propaganda, the district court said.

He denied wrongdoing, however, saying he was following orders.

“The man has by his actions exposed the five persons, all of whom were protected under international humanitarian law in armed conflicts, for humiliating or degrading treatment aimed at seriously violating their personal dignity,” the court said.

The man sought asylum in Sweden in 2015 and was detained this year after a member of the public sent the photo to the police.