In his first public remarks since abruptly resigning from Fox News last month, the anchor Shepard Smith called on Thursday for a steadfast defense of independent journalism, while offering a few subtle barbs at President Trump’s treatment of the press.

And in a surprise announcement, Mr. Smith said he would personally donate $500,000 to the Committee to Protect Journalists, a nonprofit group that advances press freedoms around the world.

“Intimidation and vilification of the press is now a global phenomenon. We don’t have to look far for evidence of that,” Mr. Smith said at the group’s annual dinner in Midtown Manhattan, an appearance he signed up for before he left Fox News, his television home of 23 years.

The crowd at the black-tie fund-raiser — which draws leading reporters, editors and executives from across the media industry — rose to its feet and applauded after Mr. Smith revealed his donation.