Dean Baquet, the executive editor of The New York Times, praised the protesters’ efforts. By blocking certain reporters from attending Friday’s open briefing, the president’s press secretary, Sean M. Spicer, “undermines one of the few institutions that has as its role asking tough, independent-minded questions of the president,” Mr. Baquet said.

The Trump administration did not respond to an email requesting comment.

On Eighth Avenue, two men held a large American flag, on which they had written “Press Freedom” in red, white and blue. On a piece of cardboard was a quotation from Senator John McCain, an Arizona Republican: “When you look at history, the first thing dictators do is shut down the press.”

The president has used Twitter to declare the press “the enemy of the American people.” Mr. Baquet disagreed, saying, “I don’t look at us as the enemy of the White House. I look at us as people who are aggressively covering the White House.”

As the protest concluded, some people waved Sunday’s edition of The Times, folded to reveal a full-page advertisement from the newspaper.

It read: “Truth. It’s more important now than ever.”