Integration key to peaceful societies
Tightening immigration and security alone are unlikely to rule out further violence similar to the attacks in Spain
Spain's counter-terrorism laws are among the toughest in Europe. Yet this did not deter a group of immigrants from turning on their neighbours on Aug 17, killing 15 people in attacks in and around Barcelona.
We do not know much about how and why they became radicalised, but it is likely they felt unwanted in Spain.
Merely limiting immigration further and ramping up traditional security measures are unlikely to rule out similar violence. But more can be done for integration, and arguably with greater impact.
Immigration is a permanent aspect of today's Europe, and it requires acceptance of new arrivals to foster healthy societies.
The perpetrators of the Spanish attacks were not Islamic State in Iraq and Syria operatives sent from abroad, but young militants in their 20s, the majority of them European citizens from disenfranchised immigrant communities.
Studies show that many immigrant communities in Europe remain marginalised.
A study found that immigrants and refugees learn local European languages slowly, face barriers to higher levels of education and face discrimination in many aspects of daily life.
Nonetheless, experts emphasised that integration is possible if the right policies are in place.
Integration requires getting more newcomers into the job market quickly, as Germany is doing by allowing refugees waiting for political asylum to receive vocational training.
The initiative, designed by Germany's business community, enables refugees to stay in Germany even if their bids for asylum are turned down.
In Sweden, immigrants are matched with a professional mentor and placed in locations that best fit their education level and work experience.
Denmark's Stepmodel programme aids immigrants in securing long-term jobs through subsidised initial employment, which is combined with on-the-job language instruction and training of new skills.
Some European countries have set up measures to improve literacy and language proficiency as soon as possible after the immigrants' arrival.
Denmark has a three-year induction programme to provide language training for up to five years to refugees.
In Germany, a group brings literacy programmes for Muslim women into mosques, while the Netherlands has pre-schools that focus on teaching children a second-language.
Ghent in Belgium and Austria's Vienna, among others, offer "toolkits" to combat discrimination and racism.
Like them, a growing number of European cities have included migrant councils in their administrations, as well as offices, that monitor and redress discrimination in work places, the housing sector and public services.
Some countries also offer courses in Islamic studies in public schools.
It is too early to know how effective these programmes are.
They seem unlikely to reduce the risk of attacks by already-hardened fundamentalists, but the authorities believe that helping those who feel like outcasts to share the fruits of a prosperous society will prevent them taking a militant road.
Paul Hockenos is a Berlin-based writer.