BERLIN (AFP) – A 16-year-old Syrian refugee was convicted in Germany Monday of planning a bomb attack on behalf of the Islamic State jihadist group and sentenced to two years’ juvenile detention.

The regional court in the western city of Cologne said in a statement that the defendant was found guilty of plotting “a serious act of violence threatening state security”.

The teenager, who was not identified by the court, was arrested at an asylum shelter in Cologne in September and went on trial in February.

Police had said the suspect’s mobile phone showed he had been in touch with an IS contact abroad and expressed willingness to carry out a bombing.

Investigators found online chat messages on the phone that included “concrete instructions” for building an explosive device.

However the court found that the plot was thwarted at a “very early stage”. “At no time was the public specifically in danger,” it said.

The teenager and his family were among the nearly 900,000 migrants and refugees who arrived in Germany in 2015, a record influx that has fuelled security concerns.

The suspect was brought to police attention after residents and employees at the refugee shelter where he was staying voiced concerns that he had been radicalised, as did a local mosque.

The court found that the “particular loneliness” of his housing situation at the shelter meant that he spent most of his time on his mobile phone, making him easy prey for jihadist propaganda online.

Germany has been on high alert since a series of attacks last year claimed by IS, the deadliest of which was a truck rampage through a Berlin Christmas market which killed 12 people in December.