The Spanish government said on Monday this week it had just discovered that the mobile phones of the prime minister, Pedro Sánchez, and the minister of Defence, Margarita Robles, had been spied on using the now-notorious Pegasus software.
According to documents from the investigation, the hacking of the PM took place twice: on 19 May and 31 May 2021. More data was said to have been taken from the PM than the defence minister. Reports said it was their private phones that had been affected.
The announcement came amid recent, ongoing allegations from pro-independence politicians in Catalonia that Madrid had been spying on them using the same Pegasus software, which is sold only to governments' spy departments by its Israeli maker.
Madrid would only say that those spying on the PM and the minister were "external" and it would publish its findings after an investigation. This prompted fierce speculation over which foreign government or body could be behind the hacking.
Around the time of the spying last year, Spain was facing a diplomatic crisis with neighbour Morocco over allowing a pro-independence leader of Western Sahara to have Covid treatment in northern Spain. This was followed by Morocco relaxing its guard on the frontier at Spanish Ceuta on the North African coast, allowing some 8,000 people to cross uncontrolled into Spain. This happened on 17 May and the next day Sánchez was hacked.
On the day of the second hacking, 31 May, Morocco announced it was giving up on diplomatic relations with Spain. Relations with Morocco have been significantly improved recently, to the criticism of opposition parties in Spain.
The minister of Defence's phone was hacked later, in June, said court documents. It has also been reported that the phone of the former Spanish foreign minister was hacked around the time of the same crisis with Morocco.
Although no country is being openly blamed, spy chief's have been highlighting the high level of overall espionage against Spain by Morocco for some time, claiming it is the second most aggressive after Russia.
The opposition has suggested the government has revealed details of the spying of the PM now to distract attention from supposed spying on Catalan politicians. On Thursday, boss of Spain's CNI spy agency, Paz Esteban, was called - in secret- before a committee of MPs to give details of the Pegasus software spying, especially last month's allegations against Madrid from Catalonia. She said there had been no mass spying.