Yesterday's events in Barcelona shocked the world. The sight of one of Europe's most peaceful, tolerant cities, a sun-dappled piece of hipster paradise, spattered with the blood of innocent people, seemed to come out of nowhere. After the string of terror events in May and June, this one leapt at us from nowhere like a bolt from the Mediterranean blue.
But, to seasoned analysts, the attack on Las Ramblas - which has been claimed by Islamic State - won't have come as too much of a shock. Because they've been warning about it for years.
In 1995, the first ever jihad-related arrest in Spain took place in Barcelona, and over a third of all terror arrests in the country between made in 1996 and 2013 were made in Catalonia.
Some of this activity took place at a very high level: Mohammad Atta, the ringleader of the 9/11 terror attacks, met al-Qaeda liaison Ramzi Binalshibh just two months before the atrocities to go over final details. They met near Cambrils, the coastal town where five suspected terrorists were shot dead last night.
Then, in 2003, a jihadist cell linked to al-Qaeda was broken up after a major police operation. Its members carried mobile phones identical to those used in the terror attacks in Madrid a year later.
The terror activity has continued apace: figures released in September 2016 suggested more than 300 terrorists had been arrested in Catalonia over recent years. Those arrested have typically been planning to commit atrocities or send other jihadists to Syria or Iraq.
Many of the offences related to the spread of propaganda material: a typical example occurred last month, when a Spanish citizen of Palestinian origin was detained on suspicion of publishing messages in support of Isis, al-Qaeda and other terror groups on Facebook.
Much of the plotting and propaganda appears to have focused on the global terror agenda: jihadists agenda have actively supported plots in other countries. In April, for example, three people were arrested in Barcelona over the Brussels terror attacks: Barcelona's Mossos d'Esquadra police directy linked those arrested with the cell which carried out the atrocity.
Yet there have also been threats at home. In one example, Spanish news site El Periodico published Whatsapp conversations purportedly from June 2015, in which a young Muslim girl in Catalonia is seen speaking to a Spanish jihadist in Syria about the possibility of carrying out a major attack in her area.
Why has Barcelona, and the surrounding area, become a hotspot for terrorists?
In 2013 Joffre Montoto, director of Catalonia's centre for strategic studies, gave an interview to local newspaper La Vanguardia in which he said: "It's very big, very cosmopolitan, with a lot of immigration from Muslim-majority countries. So it's very easy to hide here, and it's very easy to connect [with other cells]."
Montero pinpointed El Raval, the area in which Las Ramblas is situated, as the central nucleus. He said several cells had been broken up in the district, including two which had been planning to attack Barcelona's World Trade Centre as well as public transport systems. Indeed police eyes have long been trained on the area: in 2008 the Guardia Civil arrested 14 suspected jihadists in El Raval, 11 of them eventually convicted.,
El Raval is certainly one of Barcelona's most cosmopolitan neighbourhoods, and its busy streets would provide an ideal plain-sight hiding place for recruiting agents. Just this morning, right-leaning Spanish news site La Razon described the area as "the Molenbeek of Spain", saying the area has witnessed "a negative evolution as far as recruitment, spread of propaganda and negative messages are concerned."
Over the last few years a series of prominent tourist attractions, such as Borough Market, Westminster Bridge, a packed Christmas market in Berlin and the main promenade in Nice, have come under terror attack by madmen in vans and trucks. Yet Las Ramblas, the crown jewel of Barcelona's tourist trove, has remained remarkably unprotected - even though police had been monitoring the area in and around the boulevard constantly, and regularly carrying out raids.
To the casual observer, what happened yesterday was an unforeseen abomination. But surely those in charge of protecting Barcelona's streets should have seen it coming.