A girl aged 16 has been jailed by a German court for six years for what is seen as the country's first attack by a sympathiser of jihadist group Islamic State (IS).
Safia S, who was 15 at the time, stabbed and seriously wounded a police officer in the neck at the central station in Hannover.
Prosecutors described the attack as ordered and supervised by IS.
She was convicted of attempted murder and helping a terrorist organisation.
Safia S, described as a German Moroccan, was also found guilty of grievous bodily harm. Her defence had called for her to be cleared of the other charges and given a lesser sentence.
A 20 year-old man, Mohamad Hasan K, was jailed for two and a half years on Thursday because he knew of the planned attack but failed to alert authorities.
More on IS in Germany:
Safia S stabbed the 34-year-old policeman on 26 February last year, weeks after flying to the Turkish city of Istanbul to join IS in Syria. Although her mother brought her back she kept in touch with the jihadist group over the internet.
The judge cited messages on her phone as evidence that the attack was in support of IS. One text was sent to Mohamad Hasan K after the jihadist attacks in Paris on 13 November 2015 in which she wrote: "Allah bless our lions who carried out an operation in Paris yesterday".
Security camera footage from Hannover station showed her staring at two police officers. When they asked to see her identity card she lunged at one of them with a knife.
The girl later wrote to the police offer to apologise for her attack and she repeated her apology during the trial. Her legal team said they would appeal against the verdict.
Her family had warned the authorities that she had become radicalised and lawyer Mutlu Guenal argued that "the real failure lay with police".
Under German privacy laws, defendants' surnames are not publicised. The case at Celle regional court was heard behind closed doors because of Safia S's age.
Police in Hanover are also investigating a suspected jihadist plot to target an international football friendly, four days after the Paris attacks.