In this Jan. 30, 2017, file photo, Fox News Channel chief news anchor Shepard Smith appears on the set of "Shepard Smith Reporting" in New York. Smith left the network earlier this year. Credit: Richard Drew | AP

Weeks after abruptly resigning from Fox News, Shepard Smith found himself back in front of cameras Thursday night — only the longtime anchor wasn’t seated behind a news desk. Instead, speaking at an awards and benefit dinner, Smith condemned governments for attempting to “censor and stifle” journalists and took veiled shots at President Donald Trump in his first public comments since leaving the network, where he was a regular target of the president’s ire.

“Intimidation and vilification of the press is now a global phenomenon,” Smith said onstage in New York at the event put on by the Committee to Protect Journalists. “We don’t have to look far for evidence of that.”

Ahead of Smith’s sudden departure from the network in October, the 23-year Fox News veteran and vocal Trump critic was frequently singled out by the president, who regularly rails against “fake news” and calls journalists “enemies of the people.” On Thursday, Smith pledged to donate $500,000 of his own money to the nonprofit, and while he never mentioned Trump by name, he called out those in power who wield “online tools” to “dispatch troll armies after critical reporters.”

Smith began his opening remarks by describing a free press as “the underpinning of a democracy,” adding that it “cannot be taken for granted.” This year’s International Press Freedom Awards recognized journalists from Brazil, India, Nicaragua, Tanzania and Pakistan, whom Smith praised for standing up to authoritarian leaders and governments through their reporting.

“Nations are becoming far less tolerant of an independent press,” Smith said. “Sure, journalists continue to be murdered or thrown in prison when they speak out, but governments have learned other, less crude, techniques to censor and stifle our work.”

In recent years, Smith noted that the concentration of media ownership worldwide directly by governments or “through corporate cronies” has resulted in the narrowing of choices for independent news sources. Then, there is the matter of the internet and social media, Smith said.

“Our belief a decade ago that the online revolution would liberate us now seems a bit premature, doesn’t it?” he said with a smile. “Autocrats have learned how to use those same online tools to shore up their power. They flood the world of information with garbage and lies masquerading as news. There’s a phrase for that.”

Smith briefly paused, delivering a pointed look, which drew laughter from the audience.

“They dispatch troll armies after critical reporters, who are vilified and harassed,” he continued. “Their personal information, such as phone numbers, addresses and ID numbers, are posted and published as an invitation for even more attacks.”

While Smith was speaking in broad terms, the former Fox News anchor is no stranger to being the focus of online attacks, a number of which have come directly from Trump. The 55-year-old from Mississippi, who had been with Fox News since it launched in 1996, developed a reputation for “blunt honesty” and fact-checking the president on-air — a stark contrast from a majority of the network’s other hosts, who offer more favorable coverage of Trump and his administration, according to The Washington Post’s Erik Wemple.

Smith’s commentary did not sit well with Trump, who has come to view Fox News as a network that should be loyal to him.

The president repeatedly took to Twitter to disparage Smith, often claiming Fox News’s chief news anchor had low ratings. In August, Trump tweeted, “Watching Fake News CNN is better than watching Shepard Smith, the lowest rated show on @FoxNews.” Trump also referred to Smith as “low ratings Shepard Smith.”

When Smith announced that his Oct. 11 broadcast would be his last, Trump speculated that the move must have been spurred by ratings. (The Post reported that internal tensions at Fox News may have contributed to Smith’s resignation.)

“I assume he’s leaving for bad ratings,” Trump told reporters at the time, adding, “I wish him well.”

On Thursday, Smith, who reportedly signed on to host the event while he was still with Fox News, encouraged media figures to come together to protect an independent press. His promise to donate $500,000 to the Committee to Protect Journalists, citing the nonprofit’s efforts to help free two Fox News reporters held captive in Gaza in 2006, drew applause.

“We know that journalists are sometimes wary of being perceived as activists for some cause, but press freedom is not the preserve of one political group or one political party,” Smith said. “It’s a value embedded in our very foundational documents. Journalists need to join hands to defend it.”