STOCKHOLM (AP) — A Swedish court has convicted a 24-year-old Iraqi man of war crimes for posting macabre pictures on Facebook after fighting extremists in Iraq — in the first such case in Sweden.

The Blekinge District Court sentenced Raed Abdulkareem to six months in jail on Tuesday.

The court said Abdulkareem posted photos on Facebook of himself in military fatigues next to a decapitated head on a plate and bodies with severed heads, and appeared in a video taken in early 2015, moments before the still photos were taken.

Abdulkareem, who sought asylum in Sweden in late 2015, has confessed being in the pictures but denied committing war crimes.

The court said Abdulkareem was currently jailed because of an earlier 42-month sentence for robbery. He will be expelled after serving that sentence.