The deadly terrorist shooting in the German town of Hanau represents the latest in a string of far-right attacks and plots in what has long been considered one of Europe’s most stable countries.

The murderous actions of the gunman, identified in the German media as Tobias Rathjen, came only days after a dozen German men were arrested for allegedly plotting armed attacks on mosques around the country.

Their extraordinary suspected goal was to kill Muslims in “commando” style attacks with the explicit intention of provoking revenge, and even civil war. Each member was expected to contribute €50,000 to fund the operation.

Part of the inspiration was global: German prosecutors say the plotters were influenced by the violent attacks on mosques in Christchurch, New Zealand, in which a gunman killed 51 people, streaming some of it live on Facebook.

But there are also local factors. In the period since the migration crisis of 2015, when large numbers of often desperate people arrived in the country from Syria and elsewhere in the Middle East, far-right activity appears to have increased.

German police said last week they were monitoring 53 potentially violent individuals associated with the extreme right, up from 22 in 2016, and the domestic intelligence and security agencies are under intense pressure because of the growing number of plots and incidents.

“Part of the problem is that until now the German security community doesn’t seem to have been very good at dealing with the situation,” said Patrik Hermansson, of the far-right monitoring group Hope Not Hate. “In some cases, extremists have had links with the police and the military.”

Last June it emerged that a group of rightwing extremists called Nordkreuz (Northern Cross) had used police data to compile a “death list” of leftwing and pro-refugee targets. Some of the 30 or so group members had security links, with at least one still employed in a special commando unit.

The group had ordered body bags and quicklime to dispose of their potential victims, but despite the plot, Nordkreuz was not even noted as a threat by the BfV, the country’s domestic intelligence agency, in its annual report.

More recently, an antisemitic gunman, Stephen Balliet, used an improvised homemade shotgun to kill a 40-year-old woman and a 20-year-old man outside a synagogue in the eastern city of Halle. The attack, in October, could have been even worse: the gunman had tried and failed to enter the place of worship, where a congregation was marking Yom Kippur.

As in Christchurch, the attacker streamed the episode online from a head-mounted camera, saying at one point: “Nobody expects the internet SS.” The mosque plotters arrested last week allegedly tried to acquire similar “slam gun” shotguns.

Last summer Stephan Ernst, a 45-year-old with a string of convictions for violent anti-migrant crime, was arrested for allegedly shooting dead a conservative politician, Walter Lübcke, at close range outside his house in Istha, central Germany.

Lübcke was well known for his pro-migrant stance, and videos of his comments had circulated among far-right circles on YouTube. Ernst, whose DNA was recovered from the crime scene, was allegedly incensed by his opinions.

Last month Germany banned the neo-Nazi group Combat 18, with which Ernst was believed to be in contact. Founded in Britain in the early 1990s as a militant wing of the British National party, the organisation had found a new life in a country that, on the whole, remains particularly sensitive about its fascist past.

Around 200 police officers carried out raids in six German states, seizing phones, computers, weaponry as well as Nazi keepsakes from members of the group which Horst Seehofer, Germany’s interior minister, said “enjoys great respect within the far-right extremist scene” because of the country’s history.

British investigators say there are links between British, German and Nordic far-right groups online, where most people are radicalised, connecting with like-minded individuals across national boundaries using specialist social media networks such as Telegram.