Press and internet freedom advocates – including Edward Snowden – have criticised a decision by Brazilian federal prosecutors to charge the journalist Glenn Greenwald with cybercrimes as a blatant abuse of power and an existential threat to investigative reporting in the country.

Prosecutors claimed on Tuesday that Greenwald, 52, “helped, encouraged and guided” a group of hackers who obtained phone messages between key figures in a sweeping Brazilian anti-corruption investigation.

The leaked messages formed the basis for several stories published on Intercept Brazil, which Greenwald co-founded, and exposed what appeared to be collusion between then judge Sérgio Moro and prosecutors.

The prosecutors’ investigation resulted in the jailing of Luiz Inácio Lula da Silva, Brazil’s highest-polling presidential candidate at the time, and the subsequent presidential election was won by the far-right Jair Bolsanaro, who appointed Moro as his justice minister.

Snowden, who leaked files to Greenwald and others that became a Pulitzer prize-winning series of Guardian stories exposing illegal spying by US intelligence agencies, said the reporter’s arrest was an “absolute red alert”.

“This is unbelievably naked retaliation for revealing extreme corruption at the highest levels of Bolsanaro’s administration, and an existential threat to investigative journalism in Brazil,” he said on Twitter.

Lula, who was released from prison in November to appeal against his conviction, also voiced support for Greenwald. “All my solidarity to journalist @ggreenwald who was a victim of another blatant abuse of authority against freedom of press and democracy,” the former president tweeted.

Congresspeople from both left and right-leaning parties in Brazil have condemned the charges, which came as a surprise. Though Bolsanaro had joked that Greenwald could “do jail time” over the leaks, Brazil’s federal police had said a month ago it was “not possible to identify moral or material participation by the journalist”.

Brazil’s supreme court had issued an injunction last year that prohibited Greenwald for being investigated in the alleged hackers’ case, citing press freedom laws.

The Electronic Frontiers Foundation, an internet freedom group, said it was dismayed to learn of the charges. “Computer crime laws should never be used to criminalise legitimate journalistic practice,” it said. “Prosecutors must not apply them without considering the chilling effects on the free press, and the risk of politicised prosecutions.”

The American Civil Liberties Union said Donald Trump’s attacks on the press in the US had softened the ground for the prosecution of American journalists abroad. “The United States must immediately condemn this outrageous assault on the freedom of the press,” the group said in a statement.

“These sham charges are a sickening escalation of the Bolsonaro administration’s authoritarian attacks on press freedom and the rule of law. They cannot be allowed to stand.”

Greenwald said he only received the leaks and played no role in the hacking. But in a 95-page criminal complaint, Brazilian prosecutors said new audio evidence showed the journalist had played a “clear role in facilitating the commission of a crime”.

They cited a purported transcript of a conversation between Greenwald and alleged hacker Luiz Henrique Molição in which the reporter was informed the group as still monitoring the communications of its targets and asked for his opinion on how they should proceed.

The transcript quotes Greenwald telling Molição: “I can’t give you advice.” But prosecutors allege he also told the hackers there was no reason to keep archives of message they had already shared with the Intercept Brazil, which they said constituted “participation in the crime”.

The charges would have to be accepted by a judge before Greenwald would stand trial.

“It is impossible to separate these charges against Glenn from his work as an investigative reporter,” said Summer Lopez from the American branch of the free-speech group PEN. “While we don’t know all the contours of this story, we do know two things. First, Glenn’s reporting has deeply embarrassed the Brazilian government. Second, Brazil’s president has repeatedly and consistently attacked the press in general and Glenn in particular. As such, It’s hard to take these charges at face value.”

The Committee to Protect Journalists said the criminal complaint was intended to rattle investigative reporters in the country. “Charging a journalist with criminal activity based on interactions with sources sends a chilling message to reporters working on sensitive stories at a time when the media in Brazil is increasingly under attack from officials in its own government,” it said.

Greenwald has called the allegations “an obvious attempt to attack a free press in retaliation for the revelations we reported about minister Moro and the Bolsonaro government”.

“We will not be intimidated by these tyrannical attempts to silence journalists,” he said.