Ripoll was the home of most of the suspects involved in the terrorist plot, according to the authorities, including Abdelbaki Essati, the local imam, one of two men who may have died in the Wednesday explosion.

Five of the 10 other men believed to have been involved in the cell were killed in Cambrils, and four are under arrest, officials said. Mr. Abouyaaqoub is thought to have been the driver of the van. The authorities said it was possible that he had slipped into France.

Investigators are trying to establish the role of the imam, Mr. Essati, in the cell. He had been connected to extremists more than a decade earlier, and he shared an apartment in the town of Vilanova that the police raided in 2006 as part of an investigation into another cell that also recruited fighters for Iraq, according to local news reports.

The imam is also believed to have been connected to Mohamed Mrabet Fhasi, who tried to help a militant escape after the 2004 Madrid train bombings. Mr. Essati served time in prison, but on charges related to drugs, not terrorism.

Image Julian Alessandro Cadman

Major Trapero declined to give details on Sunday about the investigation into the imam’s possible role, but he reiterated that neither the imam nor the members of the cell, many of whom were teenagers, had known links to terrorism.