The Moroccan government has denied reports that it might have used Pegasus, a program created by Israeli cybersecurity firm NSO, to spy on the phones of citizens or foreign officials.
"The Kingdom of Morocco strongly condemns the persistent false, massive and malicious media campaign, evoking an alleged infiltration of the telephone devices of several national and foreign public figures," the government said.
A consortium of news outlets, cooperating with Forbidden Stories, a non-media organisation, released reports this week alleging that Pegasus was being used to scour the phones of heads of state, journalists and activists.
Pegasus takes advantage of security gaps in smartphone software to access data.
Forbidden Stories and Amnesty International had access to more than 50,000 leaked phone numbers selected by NSO clients in more than 50 countries since 2016.
The Guardian, a partner in the project, published a list of political figures who have apparently been identified as people of interest by Morocco, including French President Emmanuel Macron.
Morocco's government on Tuesday evening challenged the consortium to provide "tangible and material evidence in support of their surreal stories".
NSO said Macron was not targeted by their firm and has disputed details of some of the reports.
Morocco's King Mohammed VI himself was selected as a person of interest in 2019 by his security forces, the Guardian reported.
The mobile numbers of 13 other heads of state and heads of government were also on the list.
Another number on the list was that of South African President Cyril Ramaphosa.
Ramaphosa's office gave no comment to questions about the leak on Wednesday.
The United Nations said in New York on Tuesday it was in discussion with the US authorities over Pegasus, describing any such breach of communications as a matter of concern.
The allegations prompted Amazon Web Services (AWS) to disconnect NSO's access to the US company's cloud services.
Prosecutors in Paris said on Tuesday they had begun an investigation into the software after reports that Pegasus was being used to scour the phones of journalists and activists.
The Israeli government is forming a special team to deal with the fallout from the media revelations about the Pegasus software, according to the Axios website.