BERLIN, Dec 16 (Reuters) - A 12-year old German-Iraqi boy tried to detonate a bomb at a Christmas market in the western town of Ludwigshafen last month and planted another explosive device near the town hall a couple of days later, German prosecutors said on Friday.

Focus magazine cited security and judicial sources as saying the boy was "strongly radicalised" and apparently instructed by an unknown member of the militant group Islamic State.

A spokesman at the Federal Public Prosecutor Office in Karlsruhe confirmed that officials were investigating the case but declined to comment on any possible Islamic State link.

Nobody was hurt in either of the incidents. The boy, born in Ludwigshafen in 2004, is below the age of criminal responsibility, meaning no formal proceedings were launched against him, Public Prosecutor Hubert Stroeber said.

The youth welfare office is taking care of the boy and the Federal Public Prosecutor Office is in charge of investigating whether there are any suspects linked to him, Stroeber added.

He said the boy left a backpack containing a self-made nail bomb at the Christmas market on Nov. 26, but the device did not go off because the detonator apparently failed

He then planted another explosive device near the town hall of Ludwigshafen on Dec. 5 but an "informant" called the police and specialists defused it, he said.

The Focus magazine report said evidence pointed to the child having thought about travelling to Syria last summer to join militants.