A former Iraqi Army officer who sought asylum in Germany has been given a 20-month suspended sentence for having held up the severed heads of two Islamic State fighters for a photograph in Iraq.

The man was arrested in September under international humanitarian law on charges of degrading and demeaning people while he was fighting the extremist militia in March 2015.

He arrived in Germany with his wife later in 2015.

The man told the court in Berlin on March 1 that two other Iraqi officers had found the corpses of the two Islamic State fighters after clashes near the town of Tikrit, and had cut off their heads.

He said he was told by the two Iraqi officers to hold up their heads for a photograph and "could not withstand the peer pressure."

Based on reporting by dpa and AFP

