Federal prosecutors in Brazil have accused American journalist Glenn Greenwald of assisting a group of hackers who intercepted the phones of public officials involved in a major corruption inquiry - though the country's high court had blocked investigations of the journalist or his Brazil-based news outlet in relation to the case.

News of the criminal complaint on Tuesday was slammed by journalists and campaigners as a politically motivated effort to gag free speech. Greenwald, a critic of Brazil's far-right President Jair Bolsonaro and winner of Pulitzer Prize, said the allegations were baseless and "an attack to the freedom of the press".

More:

A federal judge would have to approve a formal charge based on allegations by prosecutor Wellington Divino Marques de Oliveira that Greenwald, a resident of Brazil, helped a group of six people hack into phones of hundreds of local officials.

De Oliveira accuses the journalist of criminal association and illegal interception of communications. He charges the six alleged hackers with criminal organisation, money laundering, cybercrimes and illegal interception of communications.

Brazil's federal police looked at the same evidence and did not find any wrongdoing by Greenwald. A ruling by Supreme Court Justice Gilmar Mendes last year barred investigations of Greenwald and his The Intercept Brasil in relation to the alleged hacking.

Still, prosecutors decided to recommend charges against the journalist, who has not been detained.

Car Wash probe

The Intercept Brasil last year published excerpts from conversations involving current Justice Minister Sergio Moro, saying they showed he was improperly coordinating with prosecutors at the time he was a judge overseeing the vast corruption Car Wash investigation.

That probe led to the imprisonment of numerous business executives and politicians on corruption charges, including former President Luiz Inacio Lula da Silva who was released from jail in November because he has appeals pending.

While many Brazilians hail Moro as a hero, others believe he unfairly targeted Lula and other top left-wing figures. Moro is now a key member of Bolsonaro's cabinet.

The Car Wash investigators' conversations were leaked to The Intercept after they had been hacked, according to Greenwald. The journalist said Moro had from the start called his publication "allies of the hackers" for revealing his collusion with prosecutors in the corruption investigation.

But the federal prosecutors said in a statement that an audio found on the seized laptop of one of the alleged hackers showed Greenwald advising him to erase all messages linked to The Intercept while the interceptions were still taking place.

"The dialogues demonstrated that Glenn Greenwald went beyond [his journalistic duty] by indicating actions that would hinder the investigation and reduce the possibility of criminal liability," the statement said.

Greenwald became known internationally for his role in the publication of classified US national security documents [Tobias Hase/ EPA]

'Defend a free press'

Greenwald's lawyers called the prosecutors' allegations "bizarre" and said the accusations challenge the top court ruling protecting the journalist and freedom of the press in Brazil.

"Their objective is to disparage journalistic work," the lawyers said in a statement.

Greenwald posted a video saying the accusation is "an attack to freedom of the press, to Brazil's Supreme Court (rulings), to the conclusions of the federal police and to Brazilian democracy".

"We will defend a free press. We will not be intimidated by the abuse of the state apparatus or by the Bolsonaro administration," he said.

Brazil's top court last year said "the constitutional secrecy" around journalistic sources prevented the Brazilian state from using "coercive measures" against Greenwald. Because of that, a judge would have to authorise any attempt by prosecutors to formally investigate the journalist or bring charges.

Judge Ricardo Leite will analyse the unusual accusation against Greenwald and the group of six alleged hackers. There is no deadline for a decision.

Greenwald became known internationally for his role in the publication of classified US national security documents leaked by former National Security Agency contractor Edward Snowden in 2013. He was awarded the Pulitzer Prize the next year.

The Brazilian Association of Investigative Journalists said in a statement that "the charges against Greenwald are based on a distorted interpretation of conversations of the journalist with his source, and has as its sole purpose embarrassing the professional, which is very serious."

Literary and free expression group PEN America said in a statement that the move against Greenwald raises serious concerns that he may be the target of politically motivated retaliation.

Article 19, an NGO that campaigns for freedom of expression, said in a statement that the news Greenwald was "further evidence of how fragile journalists' rights are in Brazil".

"These charges come after President Jair Bolsonaro threatened him with the possibility of jail time, related to his reporting. We urge the Brazilian authorities to drop all charges again and to protect press freedom."