German police
Pictured: German policeReuters File

A 12-year-old boy in Germany planned two terrorists attacks in the western city of Ludwigshafen in December and in November, a local prosecutor said on Friday.

The boy reportedly attempted twice to blow up a homemade nail bomb at a Christmas market in the city. The authorities recovered a backpack from the boy which contained a glass jar with firecracker materials and nails taped to it, according to the weekly German magazine Focus.

The boy's first attempt to detonate the bomb was made on November 25 at a Christmas market in the German town, which is home to around 160,000 people. The second attempt to launch the explosive device was made on December 5 outside the town hall in  Ludwigshafen. Reports state that the boy had placed a backpack with the device in it in the bushes near the town hall. The suspicious package was then spotted by a passerby who alerted the authorities about the bag.

The spokesperson for Germany's federal prosecution service confirmed the discovery of the device and told AFP, "I can confirm that we have started an investigation based on the discovery of a nail bomb in Ludwigshafen."

Soon after the police arrived at the spot, a bomb squad was called which detonated the nail bomb. The boy was shortly arrested by police and is currently in a juvenile facility. The boy cannot be prosecuted on stand on trial as children below 14 years of age in Germany are exempted from the federal process.

Islamist groups often target children to radicalise them as they are at high risk and more susceptible to the influence of adults. Therefore, it is easier for Islamists or terrorists to coerce children into committing a violent act or a crime.

"Either the child was trained by an adult, or there was information available online. Children are victims in the process of radicalization, as they do not have the adult experiences, life knowledge, or cognitive abilities to battle with extreme ideologies or extreme violence," a researcher at the London-based Quilliam Foundation Nikita Malik told Newsweek.

"In cases in European countries, refugee children or even in this case a citizen of the country, can be at the risk of radicalization in very much the same way that a child would be at risk of sexual grooming. Usually there is an older adult or child involved who normalizes violence and extreme indoctrination or radicalization," she added.