THE mastermind of the Barcelona terror attack in which 13 people died was an informant for Spanish intelligence services until the day of the atrocity, according to confidential documents which form the basis of a new report.

Spanish digital newspaper Publico yesterday claimed that the country’s National Intelligence Centre (CNI) was listening to and monitoring all mobile phone conversations between members of the jihadist cell headed by imam Abdelbaki es-Satty.

The revelations come after a year-long investigation, during which Publico gathered information from intelligence sources and confidential documents about the cell and its links to the CNI.

They included a communication system called a “dead letterbox”, an email account said to be fool proof – because although it is set up on a public platform no data is sent – through which Satty and the CNI spoke. Younes Abouyaaqoub, 22, who was close to the imam, killed 13 people when he drove a van through the crowded Las Ramblas in the heart of Barcelona on August 17, 2017.

He then stabbed another man when he hijacked his car but was shot dead by police days later in Subirats, a small town 30 miles outside Barcelona.

Just after midnight on the night of the Ramblas attack, a black Audi with five people inside drove through a crowd of people in the beach town of Cambrils, 75 miles from Barcelona. They hit seven people, one of whom later died from her wounds. The car overturned at a roundabout and four of the occupants were shot by police when they got out of the vehicle. The fifth person fled and was later shot.

Publico details a trip to Paris by Omar Hichamy, shot dead by police in the Cambrils attack, and Abouyaaqoub, days before the attack on the Catalan capital. The CNI monitored the trip minute by minute. It said that the day before, a house at Alcanar, where the group was making bombs, exploded, leaving the van attack in Barcelona as their deadly plan B.

Publico said the CNI continued to monitor the terrorists until the Ramblas attack, and only deleted Satty’s file from its list of sources the morning after the massacre.

The report triggered outrage among Catalan politicians and institutions, with President Quim Torra taking to Twitter: “This is a scandal of a high level. We demand an explanation from Spanish Government who should assume responsibility. Two years after the attack the victims deserve respect and information.”

Joaquim Forn, former home affairs minister, who is in prison after being tried for his role in the 2017 independence referendum, tweeted: “It is necessary to demand a thorough investigation, to purify political responsibilities, and also in the media that disseminated the theses of the Ministry of the Interior.”

Scots lawyer Aamer Anwar, who was in Barcelona on the night of the attack, added: “Exposed-leader of Jihadi terrorist group … Abdelbaki Es Satty, was informer for Spanish secret service … The victims and their families deserve truth and justice from Spain.”

In Spain’s Congress, Catalonia’s two governing parties JxCat and ERC called for an investigation and urged the Spanish Prime Minister Pedro Sanchez and the head of CNI at the time to address the chamber.

Barcelona Mayor Ada Colau, said: “It is essential that there is absolute transparency and that all details are known. Citizens need it, and above all, the victims.”