The government took the decision this week to replace the head of its CNI spying agency, provoking strong criticism from opposition parties.
The move followed the recent revelation that pro-independence Catalan politicians had been spied on in the past by the CNI using hard-to-detect Pegasus spyware on their mobile phones and the later news that the Prime Minister and other ministers had been spied on by Pegasus by a foreign body or government.
Defending his decision to replace Paz Esteban as head of the CNI this week, PM Pedro Sánchez told MPs that there had been a "clear breach of security" in allowing the spying of government ministers' phones by a government or body outside of Spain.
However opposition parties were keen to point the blame for having Paz Esteban step down on the government's unrelated need to placate Catalan MPs who had been victims of spying by Spanish authorities.
The Socialist-party-led government relies on the votes of the Catalan ERC party to stay in power and therefore has been at pains to keep them happy since the scandal of pro-independence politicians' phones being hacked was broken by The New Yorker magazine last month.
Last week Paz Esteban had told MPs behind closed doors that 18 people linked to the Catalan independence movement had been spied on - fully legally - with Pegasus software in 2019, including the regional president and ERC leader Pere Aragonès. While Esteban still seemed to enjoy the confidence of the government last week after that news, by this week she was gone.
The leader of the conservative Partido Popular party, Alberto Núñez Feijóo, said that Sánchez had turned a "problem" with his political allies into a "crisis of State".
Reports seen by SUR show that the CNI had warned ministers several times of the risks of Pegasus software.