The Brazilian Supreme Court delivered a major victory for press freedom on Thursday by barring President Jair Bolsonaro from investigating journalist Glenn Greenwald and The Intercept for reporting that exposed unethical and possibly unlawful behavior by Justice Minister Sergio Moro.

“The Brazilian Constitution robustly and expressly protects exactly the work we’re doing, and I’m grateful that the Brazilian Supreme Court has applied those guarantees against the repressive, retaliatory acts threatened by the Bolsonaro government against us,” Greenwald, co-founder of The Intercept, said in a statement.

“This crucial precedent ensures that not only we, but all Brazilian journalists, can do our jobs even in the Bolsonaro era without fear of official retaliation from the state,” Greenwald added.

The decision by Minister Gilmar Mendes comes after the right-wing Brazilian government, and Bolsonaro himself, threatened Greenwald with an investigation and imprisonment following The Intercept Brazil‘s publication of a series of articles on a trove of leaked documents, which detailed Moro’s efforts to jail former President Luiz Inácio Lula da Silva and prevent him from winning the 2018 presidential election.

“A free press is a pillar of any democracy because it is one of the few tools for shining a light on the corrupt acts carried out by society’s most powerful actors in the dark,” said Greenwald. “That’s precisely why those same powerful actors so frequently want to punish journalists for doing our jobs, as Brazil’s President Jair Bolsonaro and his Minister of Justice and Public Security Sergio Moro have been explicitly threatening to do in response to our exposés.”

A HUGE victory for press freedom in Brazil: A Supreme Court judge has ruled the Bolsonaro government must halt any and all investigations into @ggreenwald and @TheInterceptBr for their journalism. https://t.co/D0RKqUOFlw — Freedom of the Press (@FreedomofPress) August 8, 2019

Trevor Timm, executive director of Freedom of the Press Foundation, reported Thursday that Mendes’s opinion should bring to a halt any ongoing investigations into Greenwald and The Intercept by Bolsonaro’s administration and prevent it from opening new probes.

“Minister Mendes’s ruling is only preliminary, but the full court may take months or years to take on the case, so Mendes’s ruling may stand for a significant length of time,” Timm wrote. “It is a powerful rebuke of those in the Bolsonaro government who have indicated they would like to sweep aside important press freedom rights for all journalists.”

In his decision, Mendes wrote that any effort by the Bolsonaro government to investigate journalists for their work would “constitute an unambiguous act of censorship.”

“The immediate right of free speech is the right to obtain, produce, and disseminate facts and news by any means,” said Mendes. “The constitutional secrecy of the journalistic source makes it impossible for the state to use coercive measures to constrain professional performance and to impede the form of reception and transmission of what is brought to public knowledge.”