President Donald Trump -- who has called the media "the enemy of the American people" -- is being criticized as a "hypocrite" after he condemned Thursday's newsroom shooting that took the lives of five people in Annapolis, Maryland

Trump Mocked as 'Hypocrite' for Saying Journalists 'Should Be Free from Fear' After Maryland Shooting

President Donald Trump — who has called the media “the enemy of the American people” — is being criticized as a “hypocrite” after he condemned Thursday’s newsroom shooting that took the lives of five people in Annapolis, Maryland.

“This attack shocked the conscience of our nation and filled our hearts with grief. Journalists, like all Americans, should be free from the fear of being violently attacked while doing their job,” Trump said at an event touting his tax cut plan on Friday. “To the families of the victims, there are no words to express our sorrow for your loss. Horrible, horrible event, horrible thing happened.”

Get push notifications with news, features and more.

“My government will not rest until we have done everything in our power to reduce violent crime and to protect innocent life,” he added.

Five people were killed and two others were injured on Thursday when a gunman opened fire at the offices of The Capital Gazette in Maryland. The suspect, whom authorities have identified as 38-year-old Jarrod Warren Ramos, allegedly had a long-standing grudge against The Capital-Gazette, fueled by the paper’s coverage of his arrest on criminal harassment charges. Police said the suspect had previously made threats against the paper.

Image zoom Donald Trump Chip Somodevilla/Getty

Trump first commented on the shooting on Twitter Thursday, saying, “My thoughts and prayers are with the victims and their families.”

Some critics have alleged that Trump’s unrelenting and hateful rhetoric about the media could have potentially played a role in the shooting. There is no evidence thus far that this is true.

The Wire creator David Simon tweeted Thursday: “Blood today in an American newsroom. Aren’t you proud, you vile, fascist son of a bitch.”

Although he has stopped short of encouraging direct violence against the media, Trump has incited his supporters to verbally harass members of the media at his rallies, and has repeatedly attacked journalists as liars, “disgusting people” and “the enemy of the American people.”

On Twitter, many people criticized the president’s Friday comments as hypocritical and cited his past rhetoric against the media.

Think Progress founder Judd Legum wrote: “Trump, TODAY: ‘Journalists, like all Americans, should be free from fear of being violently attacked while doing their job.’ Trump, 12/21/16: ‘I would never kill them, but I do hate them. And some of them are such lying, disgusting people. It’s true.’ ”

Another Twitter user said: “@realDonaldTrump: How do you square this statement with your repeated vilification of the press as ‘the enemy of the American people’?”