Brazilian federal prosecutors have charged the American journalist Glenn Greenwald for cybercrimes in a decision which has prompted outrage among press freedom activists – and celebration by allies of the far-right president Jair Bolsonaro.

The prosecutors said that Greenwald “helped, encouraged and guided” a group of hackers who obtained cellphone messages between leading figures in Brazil’s mammoth Car Wash anti-corruption investigation.

The leaks, subsequently published in several stories on the investigative site the Intercept Brazil, which Greenwald co-founded, appeared to show collusion between then judge Sérgio Moro and prosecutors and exacerbated questions of political bias of the investigations. Moro was subsequently named justice minister by Bolsonaro.

“It’s not just Glenn and his family’s safety which are threatened by this, but all journalists and freedom of speech in Brazil. This is an attempt to intimidate the press in general,” said Rogério Sottili, the executive director of the Vladimir Herzog Institute, an NGO that advocates for democracy, human rights and press freedom.

Greenwald, who lives in Rio de Janeiro, won a Pulitzer prize for leading the Guardian’s reporting on National Security Agency (NSA) spying revealed by Edward Snowden.

After the leaks last year the president suggested that Greenwald could “do jail time” and appeared to mock the charges on Tuesday.

“Where is this guy? Is he in Brazil?” he replied to reporters in the capital Brasília.

Allies of Greenwald condemned the charges against him as an attack on the press, noting that in December, Brazil’s federal police said “it is not possible to identify moral or material participation by the journalist”.

Manuela d’Ávila, a leftist politician, tweeted: “The federal police after a long investigation declared that Glenn did not commit any crime and that he acted with great caution. We are facing a strong attack on press freedom!”

Politicians from right-leaning parties also joined the chorus of outrage.

The speaker of Brazil’s lower house, Rodrigo Maia – a member of the rightwing Democrats party, who is third in line for the presidency – tweeted: “Journalism is not a crime. Without free journalism there is no democracy.”

Brazil’s Association of Investigative journalism said: “It is ridiculous that the prosecutor’s office abuses its functions to persecute a journalist and thus violates the right of Brazilians to live in a country with a press free to expose wrongdoing by public officials.”

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

Prosecutors said that while Greenwald wasn’t under investigation himself, evidence taken from one of the accused hackers’ computers showed exchanges with the journalist which proved he had participated in wrongdoing.

In one, Greenwald said he “couldn’t give any advice” to accused hacker Luiz Henrique Molição.

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

Supporters noted that the same prosecutor, Wellington Oliveira, also charged the president of the Brazil’s bar association, Felipe Santa Cruz, with slander after he described Moro as a “gang boss” to the Folha de S Paulo newspaper.

The charges were rejected by a judge in the capital Brasília last week.

Greenwald responded to Tuesday’s announcement in a tweet: “Regarding the criminal charges brought by the Bolsonaro government: it’s a grave and obvious attack on a free press, brought by a far-right judge.

“We’re going to defend a free press, not be intimidated by authorities abusing their power. The reporting will continue.”

Allies of Bolsonaro celebrated the charges.

Bolsonaro’s congressman son, Eduardo, tweeted: “Glenn Greenwald always said that he loved Brazil and wanted to get to know the country in depth. Who knows, maybe he’ll even get to know prison …”

The president himself has recently upped his attack on journalists, describing them recently as “a species in extinction” and saying that newspapers “poison” their readers.

In a statement, the Intercept said: “We are appalled that Brazil’s Public Ministry has decided to file such a blatantly politically motivated charge against Greenwald, in apparent retaliation for The Intercept’s critical reporting on abuses committed by Justice Minister Moro and several federal prosecutors….

There is no democracy without a free press, and defenders of the press everywhere should be deeply concerned about Bolsonaro’s latest authoritarian move.”