Dmitri A. Medvedev, the former Russian president and regular forecaster of a third World War, had no hesitation in comparing the would-be assassin of Prime Minister Robert Fico of Slovakia to the young man who ignited World War I. Europe, he suggested, was once more on the brink.

The individual who shot Mr. Fico, a nationalist leader who favors friendly relations with Russia, was “a certain topsy-turvy version of Gavrilo Princip,” Mr. Medvedev said on the social network X. Princip was the 19-year-old Bosnian Serb nationalist whose assassination of Archduke Franz Ferdinand in Sarajevo on June 28, 1914, started what Churchill called “the hardest, the cruelest” of all wars.

It was on many levels a wild association to make. The Europe of empires that unraveled between 1914 and 1918 is long gone, as is the Europe that replaced it and produced Auschwitz. In their place the painstakingly constructed European Union of 27 members, including Slovakia, has been put in place with the overriding goal of making war impossible on a long-ravaged continent.

Yet, with elections to the European Parliament just three weeks way, ominous indications of brewing violence go well beyond the shooting of Mr. Fico, whose condition remains serious.

A 27-month-old war is raging in Ukraine, outside the E.U. but right on its doorstep. It is increasingly, as in World War I, a conflict involving soldiers reduced to “fodder locked in the same murderous morass, sharing the same attrition of bullet and barrage, disease and deprivation, torment and terror,” as Tim Butcher put it in his book “The Trigger,” an account of Princip’s life.