BERLIN: A German court on Thursday sentenced a teenage girl to six years of juvenile detention for stabbing a police officer in an assault “to support the Daesh group.”

The defendant, identified as 16-year-old Safia S., was convicted of “attempted murder, grievous bodily harm and support for a foreign terrorist organization,” the court in the northern city of Celle said in a statement.

“With this crime she wanted to support the so-called Islamic State (Daesh),” it said, citing chats found on her mobile phone.

Prosecutors initially believed that Daesh militants ordered the attack, but the group never claimed responsibility for it.

The hearings were held behind closed doors because the defendant, a German-Moroccan national, is a minor. The verdict met the sentencing demand presented by prosecutors last week.

One of the girl’s lawyers said she would appeal the verdict to seek a lighter sentence.

Prosecutors had argued that the girl sought to catch the attention of police officers by following them at the main train station in the northern city of Hanover. As the officers called her over for an identity check, the girl, who was 15 at the time, stabbed one of them in the neck with a vegetable knife before being subdued by another officer.

Her co-defendant in the trial, 20-year-old Mohamad Hasan K., was found to have known about the planned attack, without reporting it. He was handed a juvenile sentence of two years and six months.

Authorities believe Safia S. was radicalized as a young girl. They found a message on her phone sent to Mohamad Hasan K. after the deadly Paris attacks in November 2015, exulting about the carnage.

Germany was hit by a number of terror attacks last year, with the deadliest occurring on Dec. 19 when a Tunisian suspect rammed a truck into a crowded Christmas market in Berlin, killing 12.

The suspect, Anis Amri, who was shot and killed days later by Italian police, had sworn allegiance to Daesh.

Two attacks last July were also claimed by Daesh — a rampage on a train in Wuerzburg that injured five, and a suicide bombing in Ansbach in which 15 people were hurt.