BERLIN — Germany ranks in international studies as one of the safest, most peaceful countries in the world. Overall crime has declined for the better part of a decade, and statistics show that Germans have relatively few reasons to feel insecure.

But don’t tell that to Germans in what has become their summer of anxiety. Since June, a series of crimes — some violent and seemingly random, some targeted and political; some by migrants, and some aimed at them — have jangled nerves and amplified a sense of a nation straining at the seams.

The extent of German unease came to the fore of public debate last month after a man shoved a boy and his mother in front of an oncoming train in Frankfurt’s central station in broad daylight at the height of the summer travel season. She managed to roll to safety; her 8-year-old son was crushed and killed.

In the online discussion after the boy’s death, the Frankfurt police said on Twitter that the suspect was African, prompting an immediate outcry from members of the far-right, nationalist Alternative for Germany party, usually referred to by its German-language initials, AfD.