WASHINGTON — President Trump turned the power of the White House against the news media on Friday, escalating his attacks on journalists as “the enemy of the people” and berating members of his own F.B.I. as “leakers” who he said were putting the nation at risk.

In a speech to the Conservative Political Action Conference, Mr. Trump criticized as “fake news” organizations that publish anonymously sourced reports that reflect poorly on him. And in a series of Twitter posts, he assailed the F.B.I. as a dangerously porous agency, condemning unauthorized revelations of classified information from within its ranks and calling for an immediate hunt for leakers.

Hours after the speech, as if to demonstrate Mr. Trump’s determination to punish reporters whose coverage he dislikes, Sean Spicer, the White House press secretary, barred journalists from The New York Times and several other news organizations from attending his daily briefing, a highly unusual breach of relations between the White House and its press corps.

Mr. Trump’s barrage against the news media continued well into Friday night. “FAKE NEWS media knowingly doesn’t tell the truth,” he wrote on Twitter shortly after 10 p.m., singling out The Times and CNN. “A great danger to our country.”