KANDEL, Germany — It happened between neatly stacked rows of shampoo and organic baby food: A teenage boy walked up to his ex-girlfriend in the local drugstore, pulled out a kitchen knife with an eight-inch blade and stabbed her in the heart.

The death in Kandel, in southwestern Germany, on Dec. 27 has traumatized this sleepy town of barely 10,000 inhabitants, not just because both the suspect and the victim were only 15 years old and went to the local school, but also because the boy is an Afghan migrant and the girl was German.

From the moment Germany opened its doors to more than a million migrants two years ago, prominent episodes like the Berlin Christmas market attack and the New Year’s molestation and rapes in Cologne have stoked German insecurities.

But the case of the two teenagers, Abdul D. and Mia V., has struck a special nerve because the killing happened in such a quiet and provincial setting and the two people involved were so young. It became national news, was debated over dinner tables, on talk shows and on social media sites, and reinforced fears that Germany is becoming ever less safe.