A Berlin court has sentenced an imam to 2 ½ years in prison for a video and interview glorifying the Islamic State group and for seeking recruits for the extremist organization.

The Berlin district court on Tuesday convicted the 30-year-old, identified only as Gadzhimurad K. in line with German privacy rules, of soliciting members or supporters for a foreign terrorist organization and of condoning crimes.

The court said that the defendant posted a video in January 2015 in which he paid homage to IS and called on people to join its fight. It said he also gave a Russian-language online magazine an interview in which he sought to justify grisly killings by the group.

It said he used his "authority built up over years" among Russian-speaking extremists to seek recruits.