When Julian Assange, the WikiLeaks founder, was charged last year by the Trump administration in connection with the publication of secret United States government documents nearly a decade earlier, many journalists expressed deep concern about the dangerous precedent the case could set for investigative reporting in America.

But few seemed to consider that the case might also serve as a model for other nations eager to clamp down on press freedom.

On Tuesday, Glenn Greenwald, an American journalist living and working in Brazil, was charged, in a criminal complaint brought by Brazilian prosecutors, with cybercrimes in connection with his stories on private messages among Brazilian officials that revealed corruption and abuses at the highest levels of the government. Brazilian prosecutors asserted that Mr. Greenwald was part of a criminal organization that hacked the cellphones of government officials. He has denied the charges. (Full disclosure: Mr. Greenwald is a co-founder of The Intercept, where I work as a reporter; I also run the First Look Press Freedom Defense Fund, part of the nonprofit organization that includes The Intercept.)

The case against Mr. Greenwald is eerily similar to the Trump administration’s case against Mr. Assange. Last April, the Justice Department charged Mr. Assange with aiding a source, the former Army intelligence analyst Chelsea Manning, to gain access to a United States military computer database. In May 2019, the charges against him were broadened, and he was indicted under the Espionage Act in connection with the publication of American military and diplomatic documents by WikiLeaks.