Most of the attackers were Moroccan-born young men who had been radicalised in Catalonia. That has raised questions about whether migrant communities are integrating into society.
Low wages, poor education and racism are common obstacles to integrating Moroccan immigrant families in the European country.
Al Jazeera's Karl Penhaul reports from the city of Terrassa.