Roger Torrent, speaker of the Catalan regional parliament, outlined the claim at a press conference after the matter came to light in two reports in El Pais and Britain's Guardian newspaper.
But a spokeswoman for office of Prime Minister Pedro Sanchez told AFP the Spanish government had no knowledge of any such espionage.
Following a joint investigation, the papers said Torrent's phone had been allegedly targeted using Pegasus, an Israeli-made spyware tool which exploited a one-time vulnerability in WhatsApp software.
Quoting from a lawsuit filed by Whatsapp against the Israeli firm NSO Group, the papers said 1,400 users had been allegedly targeted over a two-week period from late April to May 2019.
Of that number, more than 100 were civil society members, human rights activists, diplomats and senior government officials.
Torrent was alerted to the breach by Citizen Lab, a research centre at the University of Toronto that worked with WhatsApp after the alleged hacking attempts were discovered.
NSO Group says Pegasus spyware can only be purchased by governments and security forces for fighting crime and anti-terror purposes.
According to details in the lawsuit, the spyware would have potentially given the operator access to emails, texts and images, and could also have been used for recording by remotely operating the phone's camera and microphone.
Torrent, who is a staunch supporter of Catalan independence, said the spyware attacks “proves conclusively” that “within the Spanish state, political espionage is used against political adversaries”.
“Such practices prove the existence of struggle against the independence movement” within the Spanish government, he said, calling for “an investigation into the facts to establish responsibility”.
If Spain's central government had direct knowledge about the spyware, “it would be complicit in a crime,” he charged. But even if it didn't, “it would be a very worrying sign of political negligence”.
But the premier's office strongly denied the accusations, with a spokeswoman telling AFP “the government is not aware” that Torrent and another former Catalan lawmaker “had been subjected to a hacking attack via their mobile phones”.
“In Spain, any intervention concerning a mobile phone is always done legally,” she said — in other words, with a court order.
Over the past decade, the wealthy northeastern Catalonia region has been caught up in a separatist struggle, pitting its pro-independence administration and parliament against the central government in Madrid.
The confrontation came to a head in October 2017 when the Catalan government staged a referendum in defiance of Madrid and later made a short-lived declaration of independence, triggering Spain's worst political crisis in decades.
In October last year, nine separatist leaders were handed long jail terms for their role in the crisis, prompting weeks of mass protests which at times turned violent.