This is not mine, but I copied it a while ago...
This is gonna keep happening, there is no clear cut solution. Here is an extremely simplified version to help understand the options that Europe has in dealing with extremist violence.
Let's say we are in the early days of human civilization, and there are two rival factions, red and blue. Red faction is in the city of Roja and Blue faction in the city of Jora, which are a hundred miles away from each other and
The city of Roja has denounced violence and has accepted citizens of Jora into it's city. Some of these new citizens still believe in the religion of Jora, and have a tough time fitting into the society of Roja. Most of the new citizens stick with other Jorans and many try to live their new life as fluidly as possible, after all they did come to Roja for opportunity.
After a few years, Jora falls into a state of constant conflict and fighting which leads to more Jorans to seek refuge in Roja. This influx of people strains the city of Roja as the Rojans feel that there are less jobs and their home is being slowly replaced with the culture of the Jorans.
To make matters worse, a new and bolder version of the Joran religion has been wreaking havoc in Jora and has spread to the city of Roja after some time. Some Jorans do not agree with the new rules, but some Jorans have, and those that do attack Rojans.
The Rojans, who have put up with the strain of the increased population, grow quickly intolerant of the acts of violence perpetrated by the radical Joran citizens.
**They now have 5 obvious options, and all of them have their flaws:**
**1.)** They remove the entire Joran population from Roja by exile, imprisonment or death
**2.)** They can ignore the attacks and chose to let the peaceful Jorans stay, knowing that more attacks will inevitably come.
**3.)** They can denounce the Joran religion and make it illegal
**4.)** They can attack the city of Jora
**5.)** They can ban all weapons within the city perimeter
None of these options will completely work because the city of Roja is in contention with an *idea* not a physical enemy. The city of Roja can only influence it's own laws meaningfully, the only way to affect Jora is through force.
**Here are the flaws with each option:**
**1.)** How can Rojans tell who is Joran and who isn't? Let's say recordkeeping is excellent in Roja, in that case, would it be unethical to exile every Joran, even the honest and hardworking ones? If we want to exile only the extreme and criminal Jorans, how can we tell them apart? Imprisonment would be costly and death would be atrocious. This option has the best chance of stemming attacks, but at a high cost that many conscientious Rojan citizens are not willing to pay.
**2.)** Ignoring the attacks sounds easy and like the most ethical towards the Jorans, but how long can the population stand idly when their fellow community members and family are being killed? If the government of Roja stands idle, it's citizens will soon take matters into their own hands if they feel justice is not being served. This option could lead to a powder keg and violent, ugly and blind mob justice.
**3.)** This option is relatively unethical and if history bears repeating, not a great sign for the state of Roja as a whole. There are also issues in how to enforce such a law, as most will continue to practice the extreme religion in secret.
**4.)** Attacking the city of Jora will accomplish nothing as Jora does not have an army to fight. In fact, attacking Jora will only cause more citizens to want to flee to Roja to escape the danger in the city and more Joran citizens to turn to violence themselves.
**5.)** Weapons are already limited within the city of Roja, and the assailants will simply chose a household item to attack with or make their own weapons within the confines of the city.
Therefore, the only solution lies in nuance. This is a battle of hearts and minds and ideology, but there is only so much a foreign government can do to prevent such attacks from happening. In fact, such attacks can not even be prevented from the state they originated from, as such religious sects operate from within the country, not the government. It is purely cultural, and stopping an idea is not an easy task. Especially not when the citizens who commit such heinous acts are often highly disconnected to the society they live in, which makes any efforts to educate them through society or a media a gamble at best.
TL;DR: Don't expect an easy solution to this