In a news conference on Saturday morning, interior minister Juan Ignacio Zoido said the cell comprised 12 young men.
Many of the men were Moroccan, and some were teenagers.
“The cell has been completely dismantled,” he told reporters.
However, the hunt for the man suspected of driving the van into people in Barcelona – 22-year-old Younes Abouyaaqoub – continues.
Abouyaaqoub is a Moroccan national who was living in the Spanish town of Ripoll.
He is not believed to be among those held or shot dead by police in the coastal resort of Cambrils, where the second attack took place.
The attacks left 13 people dead in Barcelona and one woman dead in Cambrils. Both attacks were claimed by the Islamic State group.
Police previously believed another suspect, Moussa Oukabir, was the van driver.
It emerged on Friday that Oukabir was among five men shot dead as they launched the attack in Cambrils.
The 17-year-old is suspected of using his older brother’s documents to hire the vehicle that ploughed through pedestrians on Las Ramblas.
Moussa Oukabir reportedly died along with Said Aallaa, 19, and Mohamed Hychami, 24, in Cambrils.
The identities of the other two shot by police are yet to be confirmed by authorities.
Four men, aged 21, 27, 28 and 34, who were arrested in connection with the attacks remain in custody.
Three are Moroccan and one Spanish, and police said none of them was previously known to the security services for terror-related reasons.
Moussa Oukabir’s older brother, Driss Oukabir, is reported to be one of those detained.
Said Oukabir, the father of the brothers, said he was “in shock” that his sons were suspected of involvement in the attacks.
His sons had shown no sign of radicalisation, he added at his home in Melouiya, a village high in Morocco’s Atlas Mountains.
“They lived like the young people of their age, dressed like them,” the father said.
The investigation is also centred on a house in Alcanar, southwest of Barcelona, which was destroyed by an explosion on Wednesday night.
Police believe the house was being used to plan one or several large-scale attacks in Barcelona, possibly using a large number of butane gas canisters stored there.
The apparently accidental explosion at the house forced the suspects to scale down their plans and carry out more “rudimentary” attacks.
A Spanish newspaper reported that police sources suggested the terrorists were planning to target major tourist sites.
El Espanol said one plan was to drive vans packed with explosives into Gaudi’s towering Sagrada Familia basilica in Barcelona.
The unfinished church is one of Spain’s most visited monuments, with more than four million tourists last year.
Meanwhile, new CCTV video shows the speeding van hurtling along Barcelona’s Las Ramblas promenade on Thursday afternoon.
In the video a man can be seen desperately pushing a baby buggy out of the way of the vehicle’s path.