A Syrian asylum seeker in Sweden has received a 12-year prison sentence for planning to explode one or more bombs in Copenhagen and stabbing random people with kitchen knives.

The Copenhagen City Court said Monday Moyed Al Zoebi, 32, acted on behalf of the Islamic State group. The court found him guilty last month.

The man had an accomplice, Dieab Khadigah, who was sentenced in Germany in July 2017 to a prison term of six-and-a-half years.

After an internet chat, they were to gather in Copenhagen in November 2016 for the attack.

However, Khadigah was arrested in Germany as he tried to enter Denmark with a backpack containing 17,000 matches, 17 batteries, fireworks, two kitchen knives and six walkie-talkies that Al Zoebi who lives in southern Sweden, had ordered.