The Spanish capital, Madrid, was hit by its deadliest terror attack in history
in March 2004, when coordinated bombings on commuter trains killed 191 people and injured 1,800 more.
The bombings were blamed on Islamist militants, who were based in Spain but inspired by al Qaeda.
When that attack happened, Spanish media and officials thought initially that the Euskadi Ta Askatasuna (ETA), a Basque separatist group, might have been responsible.
The Spanish government says that ETA has carried out more than 1,600 attacks and killed more than 800 people in its decades-long fight for an independent Basque state that it wants carved out of sections of northern Spain and southwestern France.
The ETA attacks have largely stopped, though the group carried out bombings as recently as 2010, mostly small-impact explosions that caused few injuries. In October 2011, the group declared an end to its armed activity, and this year it said it had completely disarmed.
After several attacks in Europe, as well as Tunisia, Spain raised its terror threat level in 2014, and again in 2015. It now sits at four, or "high," out of a maximum level of five.
Spanish officials said they had "worrying indications" about the growing risk of a terrorist attack in Spain months before they raised the level in 2014, according to Spanish newspaper El Pais.
Deadly vehicle rammings have struck other key cities in Western Europe recently. In the French city of Nice, 86 people were killed last year when a truck plowed through a crowd celebrating Bastille day. ISIS claimed responsibility for that attack.
In Berlin, a similar attack on a Christmas market in 2016 killed 12 and injured 48.
And last April, an Uzbeki man killed five people when he drove a beer truck into a crowd in Stockholm's city center.