A Brazilian judge has rejected charges against the US journalist Glenn Greenwald stemming from his role in producing a series of damaging political exposés involving the celebrity justice minister of Brazil’s far-right president Jair Bolsonaro.

Federal prosecutors last month accused Greenwald – a staunch Bolsonaro critic – of being part of a “criminal” group of hackers which had allegedly pilfered messages from the mobile phones of Brazilian prosecutors and judges.

The extracted material served as the basis for a succession of politically explosive reports published by Greenwald’s media organisation the Intercept.

The reports appeared to suggest Sérgio Moro – a prominent judge who is now Bolsonaro’s justice minister and is himself thought to have presidential aspirations – had repeatedly collaborated with prosecutors during high-profile corruption investigations, including the controversial case that saw former leftist president Luiz Inácio Lula da Silva jailed.

The decision to charge Greenwald sparked international outcry last month with many branding it a politically motivated move to criminalise journalism.

“Mr Greenwald’s articles did what a free press is supposed to do: they revealed a painful truth about those in power,” said an editorial in the New York Times. “Sadly, assailing a free and critical press has become a cornerstone of the new breed of illiberal leaders in Brazil.”

The Guardian said: “The decision to charge the American journalist with cybercrimes is an attack on democracy as well as press freedom.”

Even Fox News host Tucker Carlson came to Greenwald’s defence.

In a video posted on his Twitter account on Thursday, Greenwald welcomed the judge’s decision but said he would continue to push for a supreme court ruling “that will enduringly protect the right of a free press against further assaults from the Bolsonaro government”.

“We are going to continue to do the reporting on the archive that provoked these criminal charges in the first place,” Greenwald added.

While the judge rejected the charges against Greenwald, he did accept charges against six alleged hackers who were allegedly responsible for leaking the messages to the Rio de Janeiro-based journalist.﻿