The suspects in the attacks in Barcelona and Cambrils were planning one or more bigger attacks than those that were carried out, police say.
They said blasts on Wednesday in a town south of Barcelona deprived plotters of bomb material, so they executed simpler attacks using vehicles to ram crowds.
Police are seeking Moussa Oukabir, thought to be 17, and three others.
Oukabir is suspected of carrying out Thursday’s attack on Barcelona’s Ramblas, where 13 people died.
Scores of others were injured as a van driver zig-zagged along the famous tourist street.
Moussa Oukabir, a Spanish citizen from the northern Catalan city of Girona, is suspected of using his brother’s documents to rent the van that mowed down people on the famous boulevard.
Hours later, police killed five suspected jihadists in a second vehicle attack in the town of Cambrils. A woman injured in that attack died later.
Police said the men killed in Cambrils were linked to the Barcelona attack, which the Islamic State (IS) group said it had carried out.
Spanish Prime Minister Mariano Rajoy condemned what he called a “jihadist attack” in Barcelona. He has announced three days of national mourning and a minute’s silence was held at noon (10:00 GMT) on Friday.
Police say they are investigating the theory that the attacks were being prepared over a substantial period of time in a private house in Alcanar, a small town south of Barcelona.
Explosions ripped through the building on Wednesday evening, apparently caused by exploding gas canisters. One person was killed.
The explosives were being prepared for use in one or more attacks in Barcelona, police said.
Catalan Police Chief Josep Lluis Trapero said the actual attacks in Barcelona and Cambrils were “rudimentary” by comparison.
The driver of the van fled on foot after mowing down tourists and locals on Las Ramblas.
Catalonia’s Interior Minister Joaquim Forn, quoted by the Associated Press, said: “We had local police on the scene, but we were unable to shoot him, as the Ramblas were packed with people.”
Two images of the suspect Moussa Oukabir have been published, and police later issued a composite photo showing him and three other men – Said Aallaa, 18, Mohamed Hychami, 24, and Younes Abouyaaqoub, 22. All are Moroccan-born.
Later Police Chief Trapero said it was suspected that the driver of the Barcelona van was one of the five killed in Cambrils, though it was not clear that Moussa Oukabir was behind the wheel.
Spanish media say Oukabir rented two vans, the one used in the attack and another found hours later in the town of Vic, north of Barcelona, that was intended as a getaway vehicle.
His brother, Driss Oukabir, was arrested after reportedly turning himself in on Thursday.
Reports suggest Driss, who is in his 20s and was born in Morocco, told police he was not involved and that his documents had been stolen.
Three other arrests have been made. Two of the men are Moroccan, and the third was born in Melilla, the autonomous Spanish city on the north coast of Africa.
Police said three of the arrests were made in the Catalan town of Ripoll and one in Alcanar after Wednesday’s explosions.
They gave the ages of the arrested men as 21, 27, 28 and 34.
A Fiat van was driven down the pedestrianised avenue on Thursday afternoon, weaving from side to side and deliberately targeting people.
Las Ramblas is a central boulevard that runs 1.2km (0.75 miles) through the centre of Barcelona from the city’s Plaça de Catalunya (Catalonia Square) to the Christopher Columbus monument at the seafront.
An American businessman who was just arriving in a taxi in Las Ramblas, said the van was “weaving left and right, trying to hit people as fast as possible. There were people lying on the ground”.
Kevin Kwast, who is on holiday in Barcelona with his family, said: “Hundreds of people started stampeding through the market… we started running with them going outside right into where casualties were already on the ground.”
Seven people, including a police officer, were hit when a car was driven into them early on Friday, Catalan emergency services said.
A woman victim later died in hospital.
The attackers’ vehicle overturned and when the men got out they were quickly fired upon by police, media say. One was reportedly brandishing a knife.
Police Chief Trapero said one officer killed four of the attackers single-handedly.
The men were wearing what appeared to be explosive belts, police said, and a series of controlled explosions was carried out. The belts proved to be fake, Catalan regional head Carles Puigdemont later told local radio.
Police say the situation in Cambrils – a popular seaside resort 110km (68 miles) south-west of Barcelona – is now under control.
Citizens of some 34 countries were killed or injured in the Las Ramblas attack, the Catalan government has said. One woman died in Cambrils.
France’s foreign ministry said on Friday that 26 French nationals were injured, with at least 11 in a serious condition.
Thirteen German citizens were wounded, some seriously. A five-year-old Irish boy suffered a broken leg.
Seven-year-old Julian Cadman, a dual British-Australian national who was separated from his mother during the attack, is missing, ABC Australia reports. His mother was reportedly among the seriously injured.
Taiwan and Greece are among those saying their citizens were injured. Pakistani, Philippine, Venezuelan, Romanian, Peruvian, Dutch, Danish, Algerian and Chinese nationals were also among the casualties, officials said.
Frank Gardner, BBC security correspondent
What looked at first to be a lone-wolf attack by just one – or possibly two – individuals, has now emerged as a complex plot involving at least eight suspects, armed with knives and explosives. That’s an unusually large network for this day and age, where so-called Islamic State cautions its followers to avoid big groups so as to escape detection.
It suggests both an element of careful planning by the perpetrators and also a failure of intelligence by the normally-vigilant Spanish authorities. Spain has not experienced anything like this since al-Qaeda staged multiple bombings in Madrid in 2004.
But Spanish police, working closely with their Moroccan counterparts, have arrested dozens of suspected plotters in recent years, many with connections to the two Spanish enclaves on Morocco’s north coast. Melilla and Ceuta have a reputation of being hotbeds of extremist activity and both have provided jihadists with a gateway into the Spanish mainland.
Throughout the day online supporters of IS have been celebrating the Barcelona attack. Some have even expressed their hope it will change the course of Spanish politics, forcing the government to pull out of the US-led Global Coalition that is rapidly degrading what’s left of IS’s self-styled caliphate in the Middle East.
Please include a contact number if you are willing to speak to a BBC journalist. You can also contact us in the following ways:
Original post: BBC News – Worldhappy wheels