Islamists who carried out two deadly attacks in Spain last week had collected 120 gas canisters and intended to explode some of them at the Sagrada Família, according to Spanish media.
The canisters were found in the coastal town of Alcanar as police searched for the driver of a van that rammed into crowds in the Las Ramblas district of Barcelona, killing 14 people.
A separate vehicle attack in the town of Cambrils left one woman dead. Five suspected jihadists were killed by police.
On Sunday Spain’s king and queen attended a Mass for victims at the Sagrada Família, Antoni Gaudí’s still unfinished basilica.
King Felipe VI and Queen Letizia, the prime minister Mariano Rajoy, along with families of the victims, were among those at the Mass.
Cardinal Joan Josep Omella of Barcelona read out a message from Pope Francis, who called the attacks a “cruel terrorist act” and a “great offence to the Creator”.
In his homily the cardinal said the presence of so many people was a “beautiful mosaic” of unity to work towards the shared objective of “peace, respect, fraternal coexistence and love”.
The papal message, sent by Cardinal Pietro Parolin, Vatican Secretary of State, included prayers for the eternal repose of the dead, and for their families.
Pope Francis, it said, also prayed that God “would help us continue working with determination for peace and harmony in the world”.
Among the victims of the Barcelona attack was seven-year-old Julian Cadman, who attended St Bernadette’s Catholic primary school in west Sydney.
Mark Rix, of the Diocese of Parramatta, said specialist counsellors had been called in at the school and that staff were “devastated”.
“He was a little boy who would give his teachers a hug every day when he arrived at school. He was much loved. It’s a terrible day in this community,” Mr Rix said.