German prosecutors revealed Friday that a local 12-year-old boy with potential links to the Islamic State group attempted to detonate explosive devices at a Christmas market and town hall last month in the western town of Ludwigshafen.

Police confirmed the information, which first appeared in the German weekly news magazine FOCUS, citing security and judicial officials. The young German-Iraqi boy reportedly entered the Christmas market on Nov. 26 carrying a backpack that contained a homemade nail bomb. He left the bag along with the device inside behind, but a faulty detonator prevented it from going off.

"A backpack included a glass container with a drilled hole, through which a wire was pulled. It was filled with explosive powder … and prepared with nails," FOCUS reported.

A little over a week later, the boy brought a second explosive device to the Ludwigshafen town hall on Dec. 5 and planted it in a nearby waste container. The attack was foiled by an "informant," Reuters reported. The individual called police who diffused the bomb.

Due to German law regarding minors and criminal responsibility, the 12-year-old boy who was born in Ludwigshafen and was of Iraqi descent was not arrested or charged with any criminal wrongdoing but instead sent to foster care. It is believed the young boy was "strongly radicalized" and had planned a trip to Syria this past summer. Investigators said he possibly took orders from members of the Islamic State group, also known as ISIS, to carry out last month's attempted attack.

"Security officials are checking whether ISIS is targeting children and adolescents for potential terror attacks in Germany and Europe because they are least expected to commit violent acts," Elmar Thevessen, deputy editor-in-chief and terrorism expert at German public news outlet ZDF, told NBC.

Security has been a serious topic of debate in Germany after migrants this year carried out several violent attacks, two of which were claimed by ISIS. Police and counterterrorism officials have also arrested a number of migrants charged with planning Islamist-inspired terror attacks on Germany. The climate of fear led to reprisal attacks targeting migrants, 900,000 of which arrived last year alone in Germany.