A 12-year-old German-Iraqi boy suspected of having links to the Islamic State (IS) group tried to detonate a bomb at a Christmas market in the western town of Ludwigshafen, German magazine Focus reported on Friday.

The boy, born in the same town in 2004, was "strongly radicalised" and apparently instructed by an unknown IS member, Focus cited security and judicial sources as saying.

The suspect put down a backpack containing a self-made nail bomb at the Christmas market on 26 November, but the device did not go off because the detonator failed, it said.

A market visitor called the police after finding the backpack and specialists defused the device, the report said.

Police identified and arrested the boy, who is now in youth custody, the report said.

The federal public prosecutor had taken over investigations on the charge of a serious act of violent subversion.

A spokesman at the prosecutor's office in Karlsruhe was not immediately available for comment.