Police officers on duty in Hamburg's mainrailwaystation
Police officers on duty at Hamburg's main railway station Getty

A 15-year-old girl who stabbed a police officer at Hanover's main train station in February of this year may have been acting under the orders of Islamic State (Isis), according to German media reports.

The teenager, named only as Safia S, described travelling to Turkey in January on various online chat rooms, and it was here that she was in contact with "employees" of Isis, Suddeutsche Zeitung and public broadcaster NDR and WDR have reported, after being given access to the chat rooms' logs.

The chat logs showed that instead of travelling on to Syria as she wished, Safia S was told by IS extremists in Turkey to return to Germany and cause a "surprise for the unbelievers". In other passages, the girl allegedly spoke about a "martyrdom operation".

"They told me it has a greater benefit," Safia S wrote, adding that it would be "really fun".

The girl was brought back to Germany by her mother before allegedly launching the attack on the police officer on 27 February 2016.

In CCTV footage, she is approached by an officer and asked for her identification papers in a routine check. While he is distracted reading them, she stabs him in the neck, Bild reported. The officer suffered life-threatening injuries in the attack but recovered following surgery.

In another online conversation, she allegedly expressed support for the 13 November terror attacks in Paris, in which 130 people were killed. She described it as her "favourite day" because "our lions were in action in Paris".

A spokeswoman for German federal police confirmed that there are "grounds for suspecting that behind the act was a concrete instruction from ranking members of the so-called Islamic state".

The girl's lawyers have described allegations that their client was working under orders of Isis as "nonsense."

Safia S is currently held by police on suspicion of attempted murder and supporting a foreign terrorist organisation. The forums she used to discuss her views and plans are also under investigation for not reporting a criminal offence.