MEXICO CITY — The messages arrived at a familiar moment of crisis for Mexico’s fragile journalist community — another reporter killed in the line of duty.
Javier Valdez, a prominent investigative reporter, had been shot dead only a day earlier. Then came a sudden breakthrough: According to a text message received by his colleagues, his killers had been detained.
Despite the tragedy, his co-workers were suspicious. More than 90 percent of murders go unsolved in Mexico. How did the authorities solve the case so soon?
More likely, they worried, the text messages were an attempt to infiltrate their smartphones — part of a pattern of hacking attempts involving sophisticated spying technology bought by the Mexican government.
They were right.
The messages were infected with a spyware known as Pegasus, which the Mexican government purchased from an Israeli cyber arms dealer called the NSO Group, according to a forensic analysis by the Citizen Lab at the Munk School at the University of Toronto.
A simple click on the links embedded in the messages would have infected the cellphones with spyware powerful enough to break through encrypted messaging, monitor emails and remotely activate the camera and microphone.
Someone was trying to spy on Mr. Valdez’s closest friends and colleagues the day after he was killed last year — most likely the Mexican government, according to those targeted.
“I believe they wanted to search our conversations and messages for clues to the murder of Javier, but we are absolutely against this,” said Ismael Bojórquez, the co-founder and news director of Rio Doce, the news organization where Mr. Valdez worked. “Nothing obtained illegally should be used in an investigation, and especially not from those who are involved professionally and emotionally to the victim.”
The illegal use of the surveillance technology in Mexico first emerged during the administration of Mr. Peña Nieto, which bought the spyware on the condition that it be used only to target terrorists and criminals.
But in the last year and a half, the Citizen Lab has confirmed nearly two dozen highly questionable targets, including some of Mexico’s most prominent journalists, human rights lawyers and anticorruption activists.
When news of the surveillance erupted last year, the Mexican government denounced the spying and opened a federal investigation into any misuse of the technology.
But the federal investigation has gone nowhere. Not a single individual has been punished for abusing the system.
Well aware of the scandal, Mr. Bojórquez said he had little faith in the messages he was receiving. He and another target — the news director, Andres Villareal — refused to click on the links. They had reason to be suspicious.
The men were running one of the few independent news groups in the nation, dedicated to covering organized crime and exposing the underbelly of Mexico’s vast nexus of crime and corruption.
Their work made them few friends. Threats came with the territory, and not just from organized crime. Government data show that public officials are responsible for the greatest number of assaults and attacks on journalists.
But Mr. Valdez’s work and international profile, they figured, protected him. He was known and beloved by local and foreign journalists alike, and was the recipient of awards and recognition globally.
His death and the subsequent targeting of newsroom leaders exposed two of the most devastating risks to the freedom of expression in Mexico today.
One is the physical threats to journalists and, by extension, freedom of speech in Mexico. More than 47 journalists have been killed since Mr. Peña Nieto took office in late 2012, 15 of them after Mr. Valdez’s death in May of last year, according to Article 19, a journalist protection group.
“We believed that a journalist as prestigious as Javier was untouchable,” Mr. Bojórquez said.
“When they killed Javier, we understood from that point on that they could kill anyone,” he added. “We understood that the paradigm had been broken.”
The second risk is a separate but connected facet of the rule of law in Mexico: There is essentially near total impunity when it comes to how it is broken or applied — a dynamic underscored by the use of illegal spyware to intimidate and spy on pro-democracy voices.
Dating back to 2016, the target list has been a who’s who of Mexico’s most prominent voices aiming to bring accountability to the nation, including the directors at Rio Doce.
Mr. Bojórquez said he and others had become aware of the government’s potent spyware in February 2017, when the Citizen Lab and The New York Times published articles outlining its illicit use against backers of a nationwide soda tax.
The investigations detailed the purchase of the spyware by the Mexican government, and included details about its proper use. The Israeli company claimed it had sold the software only to governments, and said it had measures in place to ensure that its clients followed the ethical guidelines stipulated in purchasing agreements.
Mexico’s government was deeply embarrassed by the scandal. And yet months after the attempted hacking of doctors and activists promoting a tax on sugary drinks in Mexico, which is suffering a diabetes crisis, the targeting did not stop.
“These infection attempts are reckless, and probably indefensible,” said John Scott-Railton, a senior researcher at Citizen Lab, adding that the company had already been exposed for abuses previously. “Where was the internal oversight? And where was NSO’s oversight?”
“We hold ourselves to a rigorous standard of ethics and regulatory compliance and take any accusation seriously, no matter the source,” a spokesperson for NSO said. “We do not tolerate misuse of our products against civil rights activists, journalists or any innocent person. If there is suspicion of misuse, we investigate it and take the appropriate actions, including suspending or terminating a contract.”
Mexico has become an emblem of problematic use of spyware. In a series of articles in 2017, The Times and the Citizen Lab detailed the extensive use of the malware against journalists, minors, human rights lawyers, politicians and anticorruption activists. It also included critics of the president.
The NSO Group claimed that it monitored abuses of its software and intervened to stop clients from targeting people who did not fall within the permitted categories.
But even after suspicious targeting was unveiled in February 2017, operators in Mexico continued their illicit spying.
Mr. Peña Nieto’s tenure has been marked by scandals: the questionable purchase of a multimillion-dollar home by his wife from a favored government contractor; the unsolved disappearance of 43 students; and the widespread hacking of the nation’s nascent pro-democracy movement. His six years in office has also seen an unprecedented rise in homicides.
By this summer, Mr. Peña Nieto’s long-dominant Institutional Revolutionary Party, which has governed for nearly a century with few interruptions, was practically broken. Across both houses of Congress and in the race for the presidency, it suffered devastating losses.
In response to the latest revelations about the targeting of Mr. Valdez’s colleagues in the aftermath of his murder, the government had little to say.
The government said it could not comment on the specifics of the continuing investigation, but that it has been open to collaborating with the victims and remains committed to pursuing any charges should evidence emerge.
A new government comes into office in the next week, arriving on a wave of popular support. But whether the status of journalists will change in the country, and whether their targeting and abuse, and state overreach will subside, is an open question.
“A change in government does not mean there will be a change in the context of impunity or aggressions against journalists,” Mr. Bojórquez said. “If there is no change to the impunity, the murder of journalists will continue.”