BERLIN (AP) – A migrant was convicted Monday of murdering his 15-year-old German ex-girlfriend and sentenced to 8.5 years in prison, the German news agency dpa reported.

The stabbing of the 15-year-old girl at a drug store in the southwestern town of Kandel in December 2017 shocked Germany and fueled a debate about violence by migrants.

The verdict comes at a time when Germany is struggling to come to terms with the influx of more than 1 million migrants since 2015.

Emotions have run high after another fatal stabbing last month, allegedly by two migrants, in the eastern city of Chemnitz. It has triggered sometimes violent protests by far-right groups.

Because of privacy rules, the victim in the Kandel stabbing has been identified only as Mia and the migrant as Abdul D., who was also convicted of assault at the district court in Landau. The perpetrator’s nationality and his age couldn’t be confirmed with absolute certainty by authorities, but German media have reported that he is most likely Afghan and he was tried as a minor.

Abdul D. said he was 15 at the time of the murder, but an age evaluation during the trial came to the conclusion that he was at least 17, dpa reported. Young asylum-seekers, especially unaccompanied minors, have more privileges and get better care in Germany than older asylum-seekers, which is why some of them lie about their age when they apply for asylum. The Kandel case, therefore, has also led for calls to better determine the age of migrants upon their arrival in Germany.

The victim had ended the relationship with the migrant a few weeks before the murder, dpa reported. Twelve days before the fatal attack, she pressed charges against him including insult and threat. Prosecutors claimed during the trial that the migrant acted out of jealously and revenge and that he wanted to punish her.

Far right groups used her killing to stage several protests against migrants in the small town near the French border -with pro-migrant counter-protests quickly following.