The day after an attack killed 13 people in Las Ramblas in Barcelona, locals try to make sense of the horror. (Raul Gallego Abellan/The Washington Post)

Spain was seized Friday with the realization that it had incubated a large-scale terrorist plot, as authorities across Europe mounted a manhunt following the deadliest attacks to strike the country in more than a decade: two vehicle assaults in Barcelona and a Catalan coastal town.

Investigators say they believe that at least eight people plotted the attacks, putting them at a level of sophistication comparable to major strikes in Paris and Brussels in recent years. Other more recent attacks in London, Berlin and the southern French city of Nice were perpetrated by individuals operating largely on their own.

Spanish counterterrorism officers were scrambling to untangle the terrorist network, which involved at least four Moroccan citizens under age 25, according to intelligence officials. In addition to those four, authorities have detained three Moroccan men and a Spaniard.

In a sign that the attack could have been significantly worse, police said they believed the assailants were planning to use propane and butane canisters in an explosive assault against civilians. Instead, the gas ignited prematurely, destroying a house in Alcanar, a little over 100 miles southwest of Barcelona that was being used by the suspects. The explosion killed at least two people and injured 16, including police officers and firefighters investigating the site.

Hours later, police said, one of the suspects set out for the touristy Las Ramblas area of Barcelona in a white delivery van, which he used to mow down pedestrians strolling along the tree-lined promenade.

What we know about the two vehicle attacks in Spain

As of Friday evening, the fate of the main suspect — the driver of the van, who fled on foot after the rampage — was unclear. Police were investigating the possibility that he was among five assailants killed early Friday in a second vehicle attack in Cambrils, a seaside town about 70 miles southwest of Barcelona.

Meanwhile, the nation began to mourn the international group of 13 victims — including at least one American — who were fatally struck in the heart of Barcelona’s tourist district late Thursday afternoon. A 14th victim was killed in the second ramming attack.

The slain American was identified by his family as Jared Tucker, 42, of Lafayette, Calif., in the San Francisco Bay area, who was on a belated European vacation with his wife to celebrate their first wedding anniversary.

In Washington, the State Department said Friday that Spanish authorities still have not identified all of the casualties, so the U.S. Consulate in Barcelona is working with them to determine whether any more Americans were killed or injured.

The bloodshed prompted France to announce it was reinforcing its frontier with Spain, a sign of fears that further violence could spill beyond Spanish borders. Anti-immigrant Central European leaders seized on the suspects’ nationalities to call for tighter controls on migration.

In Finland, two people were killed and six others wounded in a stabbing Friday in the southwestern city of Turku, police said. They said the incident was not being investigated as terrorism, although the motive and identity of the suspect, who was apprehended, were not immediately clear, and Finnish intelligence services joined the investigation.

The Islamic State claimed that its “soldiers” carried out the Barcelona attack, but the level of actual involvement by the terrorist group was unclear.

Moroccan connection

Spanish intelligence officials were circulating at least four names among their European counterparts Friday, according to a Spanish intelligence official and a European intelligence official, both of whom spoke on the condition of anonymity to discuss the situation.

The four men, all holding Moroccan citizenship, ranged in age from 17 to 24. Three were born in the North African country: Said Aallaa, 18; Younes Abouyaaqoub, 22; and Mohamed Hychami, 24. The fourth was identified in a Spanish police document as Moussa Oukabir, 17, but the European intelligence official said Spanish officials had flagged someone with the same family name but a different first name. All lived in or near the Catalan town of Ripoll, close to the French border.

At least three of the men were killed in the attack in Cambrils, the Spanish intelligence official said, without identifying which of them were dead.

Two Spanish security officials said police originally sought Oukabir’s older brother because his identity card was found in the truck used for the Barcelona attack. The older brother, who is in custody, denies any connection to the attack and said his brother may have stolen his identity card, the official said.

“We cannot rule out further attacks,” Maj. Josep Lluís Trapero, a Catalan police official, told reporters in Barcelona.

Authorities were not aware of any previous connection to extremism among the detained men, he said.

All five men involved in the second attack in Cambrils were shot dead after plowing an Audi into people along the corniche at about 1 a.m., Trapero said.

The nationality of the men was sure to raise alarm in European counterterrorism circles. Moroccan networks also were connected to major terrorist attacks in France and Belgium in recent years. Spain has a significant Moroccan population, and there has been a spike in arrivals of migrants from Morocco by sea this year.

Their background also prompted Europe’s anti-migrant politicians to condemn what they said was a connection between migration and terrorism, even though there was no evidence that the men were part of the waves of migration from Africa and the Middle East in recent years.

“It is evident to everyone that there is a correlation between illegal immigration and terrorism,” Hungarian Foreign Minister Peter Szijjarto told his country’s MTI news agency. “Europe must protect itself, and the security of the people must be guaranteed.”

Debate over meaning

In Barcelona, thousands of people gathered at midday Friday in a square at the top of Las Ramblas for a minute of silence, led by Spanish King Felipe VI and Prime Minister Mariano Rajoy. Afterward, they cheered, held single red roses to the sky and chanted in Catalan, “I am not afraid.”

The whole Las Ramblas neighborhood was eerily quiet Friday morning as heavily armed police patrolled.

Later in the day, tourists and onlookers filled the long boulevard, turning what is ordinarily a vacation hot spot into a site of mourning. Some set out candles to commemorate the victims. 

Less than 24 hours after the attack — and before many details were confirmed — a fierce debate erupted in Barcelona over the meaning of what had happened. Demonstrations materialized Friday evening over the place of Islam in Europe. A small group of far-right demonstrators gathered in Barcelona’s main square to protest what they called the “Islamicization of Europe.” They were met by thousands of counterprotesters who decried Islamophobia, waved rainbow flags and shouted slogans such as “Barcelona! Anti-fascist!”

In several tweets, President Trump said U.S. agencies were “on alert” and charged that court challenges and opposition from Democrats have made security “very difficult.” He gave no specifics.

“Radical Islamic Terrorism must be stopped by whatever means necessary!” Trump wrote. “The courts must give us back our protective rights. Have to be tough!”

The attacks Thursday and Friday marked the latest uses of vehicles in terrorist strikes against civilians, following attacks since the middle of 2016 in Britain, France, Germany and Sweden.

Spain’s civil protection agency said 120 people were injured in the Barcelona attack and an additional six in Cambrils. The casualties included people of at least 34 nationalities, underscoring the international draw of the cosmopolitan Las Ramblas area, which has long stood at the heart of the city. France’s Foreign Ministry said 26 of its citizens were injured, 11 of them seriously.

Residents of Barcelona said they had long feared an attack on their bustling city.

“This is a huge city, and somehow we were always expecting something like this, but of course you’re never prepared,” said Cristina Nadal, 44, an aide for the Catalan government, who came to Friday’s moment of silence.

The crowd was “exactly what we wanted to show — that although the terrorists want to beat us, we can show to the world that we can still stand strong,” she said.

Two longtime Muslim residents of Barcelona said they were furious about the violence.

“What Islam teaches us is that killing one person is like killing all of humanity,” said Nagma Jawed, 40, who moved to the city 20 years ago from her native India and runs a textile shop in the city.

“First of all, we are human beings. Our religion comes after that,” said Jawed, who was wearing a headscarf Friday as she stood in the square with her husband for the mourning ceremony.

Birnbaum reported from Brussels and Mekhennet from Frankfurt, Germany. William Booth and Raúl Gallego Abellan in Barcelona, Paul Schemm in Addis Ababa, Ethi­o­pia, and Brian Murphy in Washington contributed to this report.