Washington: US President Donald Trump, who has repeatedly denounced the press as "the enemy of the American people", says the attack on the Capital Gazette, which left five dead and others injured, "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. He went on to tell the families of the victims: "There are no words to express our sorrow for your loss. Horrible, horrible event, horrible thing happened and you're suffering."

The alleged shooter, who had a history of harassing the paper's journalists, was ordered to be held in jail on Friday on five counts of first-degree murder. It was the deadliest attack on journalists in US history.

The gunman had filed a defamation suit against the paper in 2012 that was thrown out as groundless, and he repeatedly targeted the paper's staff members in profanity-laced tweets.