It was due to procedural errors and a lack of communication among investigators, two police sources and two individuals close to the investigation said.
The errors and miscommunication centred around a major blast on Aug 16, the eve of the attack, at a house where suspected Islamist militants were making explosives, the sources said.
For several hours, Catalan police did not link the explosion to militancy and so no public alarm was raised, before an accomplice drove a van into crowds in Barcelona, killing 13 people in Spain's deadliest attack in more than a decade.
Catalan police, the Mossos d'Esquadra, also took 10 hours to send bomb experts to the scene of the explosion in a town about 200 km (125 miles) southwest of Barcelona, the region's capital, delaying the discovery of the militant cell, the sources added.
The sources declined to be identified because of the sensitivity of the issue or because they were not authorised to speak to the press.
A judicial source said that, as part of the investigation into the attacks, police would look at whether a lack of coordination or information-sharing had contributed to the delay in discovering links between militancy and the explosion.
The source said police needed to complete the investigation before reaching any conclusions about possible errors.
Mossos chief Josep Lluis Trapero told reporters on Monday that it was unfair to criticise his force with the benefit of hindsight.
"Now, with all the information that we have, yes, it is easier to make the link, but that's playing dirty and it deceives people," Trapero told a news conference.
Enter a name and e-mail address and we will e-mail this website link too them.