German prosecutors have indicted a 21-year-old German citizen accused of posing for photos with severed heads in Syria.

Federal prosecutors said Friday that the man, identified only as Aria L. in line with German privacy rules, was charged with committing a war crime. He has been in custody since being arrested in October.

Prosecutors said in a statement Friday that he traveled to Syria in early 2014 with the intention of joining Islamic extremist militias, and met an acquaintance from Germany who gave him weapons training.

They say that, at some point before mid-April 2014, the suspect was photographed with his acquaintance and another person posing in front of two severed heads impaled on metal spikes. One of the pictures was shared on social media.