AT A RECENT ceremony in Berlin to commemorate the victims of the Nazis, Frank-Walter Steinmeier, Germany’s president, issued a bleak warning: “Hatred and abuse are spreading,” he said, in front of an audience that included his Israeli counterpart. Having imagined that “the spectres of the past would vanish with time”, Germans now see them “raising their ugly heads again in a new guise”.

A shooting spree in the town of Hanau, near Frankfurt, appears to have proved Mr Steinmeier depressingly right. On the night of February 19th a gunman attacked two shisha bars, killing at least nine people. All had, in the German argot, a “migration background”, as do most of the injured. Five of the dead are said to be Turkish nationals. The federal prosecutor said that the perpetrator acted from racist motives. A few hours after the attacks police found the suspect’s corpse, and that of a woman believed to be his mother, at his flat.

Several German politicians noted that the massacre slots into a grim pattern of recent far-right violence. Last June Walter Lübcke, a regional politician from Angela Merkel’s Christian Democratic Union (CDU) who had backed her refugee policy, was shot dead at home in Kassel. On Yom Kippur, in October, a young man armed himself with home-made grenades and assault rifles and attempted to carry out a massacre at a synagogue in Halle. Thwarted by its locked doors, he turned his guns on two innocent bystanders. Weeks later, in the same city, unidentified gunmen shot at the (unoccupied) office of Karamba Diaby, a black Social Democrat MP who receives a steady stream of death threats. Last week German police disrupted a network of extremists they said were planning a series of deadly raids on mosques across the country. Mrs Merkel linked the Hanau attacks to some of these events. “Racism is a poison, hatred is a poison...and it is to blame for far too many crimes,” she said.

German security authorities stand accused by left-wingers of responding too slowly to the far-right menace. Some recall the National Socialist Underground (NSU), a neo-Nazi gang that between 2000 and 2007 killed ten people, carried out bombings and robbed banks, while police botched the response. A subsequent rise in Islamist violence no doubt diverted attention and resources, with good reason: Islamist terrorists have killed 17 people since 2011, 12 of them in one attack on a Berlin Christmas market in 2016. But the Islamist threat is dwarfed by that of the far-right. Last year domestic intelligence agencies counted 32,200 far-right extremists in Germany. The army itself is suspected of harbouring hundreds.

A separate concern centres on the far-right Alternative for Germany (AfD) party. Since the refugee crisis in 2015-16 the AfD has shifted ever-rightwards, fostering racial tensions that some say contribute to an atmosphere in which violence thrives. Its politicians delight in portraying shisha bars as shady dens of money-laundering and other nefarious activities. The Hanau attacks should strengthen the cordon sanitaire other parties have erected around the AfD, which was recently damaged after the CDU voted with the party to eject a left-wing government in the eastern state of Thuringia. (The scandal toppled Annegret Kramp-Karrenbauer, the CDU’s leader and Mrs Merkel’s heir presumptive.) The political problem is trickiest in the east, and yet, Halle apart, most recent incidents of far-right violence have taken place in the west.

Peter Neumann, a terrorism expert at King’s College London, distinguishes between organised neo-Nazi groups—who often have a long track record of violence but, bar the NSU, have rarely engaged in full-blown terrorism—and more recent attacks committed by individuals who have assembled their own “DIY” ideologies from the internet. Like the Halle perpetrator, the Hanau suspect appears to have been unknown to the authorities and apparently unconnected to organised groups. Instead, he was marinated in an online world of racist fantasy and conspiracy theories. A “manifesto” he supposedly wrote last year, a copy of which was seen by The Economist, urges the total destruction of most countries in north Africa and the Middle East, but is largely devoted to paranoid allegations of surveillance and shadowy conspiracies.

Germany’s authorities, understandably committed to weeding out far-right violence geared towards traditional neo-Nazi groups, may not have all the tools needed to handle such amorphous threats. Indeed, says Mr Neumann, the German experience does not appear especially distinct from that of other countries, citing recent attacks in America and New Zealand. The suspects in both Halle and Hanau addressed imagined audiences in English; they “see themselves as part of a global community of like-minded people”, says Mr Neumann.

One particular danger in Germany is that the worlds of organised neo-Nazis and internet-enabled terrorists may start to blend. The terrorist cell dismantled last week had been assembled largely through chat rooms and messaging services; many of its members had never met. German intelligence services have belatedly woken up to this danger. As Mr Steinmeier pointed out, old threats can take on a new guise.