A 15-year-old Afghan refugee was in police custody on suspicion of manslaughter in Ludwigshafen on Thursday after allegedly stabbing his ex-girlfriend to death in the southwestern German town of Kandel, in the state of Rhineland-Palatinate.

Authorities said the girl, also 15 years old, was stabbed following an apparently chance meeting with the boy at a drugstore on Wednesday. She died of her injuries after being attacked with a kitchen knife with a 20-centimeter blade.

The girl was taken to hospital following the attack, where she died shortly afterward. About 15-20 people were present in the drugstore at the time of the stabbing.

Read more: German police arrest man for fatally stabbing woman and child in Teningen

According to the police, the alleged perpetrator is a refugee who came to Germany unaccompanied in the spring of 2016. Investigators said he had a relationship with the victim for several months.

After his registration in Frankfurt, he moved to the Germersheim district in Rhineland-Palatinate, where he lived in a juvenile care institution until September. He was then transferred to a supervised youth living group in Neustadt.

The teenage girl was stabbed at a drugstore in Kandel, in the Germersheim district in Rhineland-Palatinate

At a press conference on Thursday in Ludwigshafen, senior prosecutor Angelika Möhlig said that according to current knowledge, the relationship ended when the girl broke up with the boy in early December. The breakup occurred via social media, as well as through repeated telephone calls, police said.

Despite this, police said the exact motive is still unclear. "We're at the beginning of the investigation," said Möhlig.

Read more: Romanian man gets life for murdering German jogger

Möhlig said a judge ordered that the suspect, who has not been identified, be kept in custody on suspicion of manslaughter.

While the boy is currently being held on allegations of manslaughter, investigators will examine whether his actions constitute murder. The maximum penalty for both manslaughter and murder under German juvenile law is 10 years.

At the Thursday press conference, deputy chief of police Eberhard Weber said the girl's parents had filed a criminal complaint about the boy on December 15, after he threatened their daughter for breaking up with him.

law/jil (AP, dpa)