Donald Trump ignored questions about the killing of five people at a newspaper in Maryland, walking silently past reporters at the White House as they asked him for “any words about the dead”.

The president did not respond when asked for “any words of condolence” for families of the victims of the shooting at the Capital Gazette's offices in Annapolis on Thursday.

Police said a man with a grudge against the local paper had opened fire using a shotgun in a “targeted attack” which killed four journalists and a sales assistant.

Jarrod Ramos, 38, lost a defamation lawsuit against the paper in 2012 after it reported his campaign of harassment against a woman he went to school with.

Mr Trump offered his “thoughts and prayers” to the victims of the shooting in brief message on Twitter on Thursday afternoon.

But TV footage later showed him ignoring requests to speak about the massacre as he arrived back in Washington by helicopter following a campaign-style visit to a factory in Wisconsin.

In the clip, he glances towards journalists and walks away as one shouts: “Can you please talk to us about the dead reporters in Annapolis? Do you have any words of condolence for the families, Mr President?”

Another reporter asks: “Why are you walking away?”

Maryland shooting: Capital Gazette newspaper staff targeted Show all 10 1 /10 Maryland shooting: Capital Gazette newspaper staff targeted Maryland shooting: Capital Gazette newspaper staff targeted Police respond to the shooting in Annapolis, AFP/Getty Images Maryland shooting: Capital Gazette newspaper staff targeted Pat Furgurson, staff reporter of the Capital Gazette, reports outside the scene of a shooting EPA/JAY FLEMING Maryland shooting: Capital Gazette newspaper staff targeted Police and first responders attend the scebe EPA Maryland shooting: Capital Gazette newspaper staff targeted A member of the FBI responds to the shooting in Annapoli AFP/Getty Images Maryland shooting: Capital Gazette newspaper staff targeted Authorities work at the scene AP Maryland shooting: Capital Gazette newspaper staff targeted Emergency personnel outside the Capital-Gazette newspaper Getty Images Maryland shooting: Capital Gazette newspaper staff targeted Capital Gazette reporter Chase Cook, right, and photographer Joshua McKerrow, left, work on the next days newspaper while awaiting news from their colleagues. AFP/Getty Images Maryland shooting: Capital Gazette newspaper staff targeted Police respond to a shooting in Annapolis, Maryland, June 28, 2018. At least five people were killed Thursday when a gunman opened fire inside the offices of the Capital Gazette, a newspaper published in Annapolis, a historic city an hour east of Washington.A reporter for the daily, Phil Davis, tweeted that a "gunman shot through the glass door to the office and opened fire on multiple employees.""There is nothing more terrifying than hearing multiple people get shot while you're under your desk and then hear the gunman reload," Davis said. / AFP PHOTO / SAUL LOEBSAUL LOEB/AFP/Getty Images SAUL LOEB AFP/Getty Images Maryland shooting: Capital Gazette newspaper staff targeted "This was a targeted attack on the Capital Gazette," William Krampf, the Anne Arundel County acting police chief, said Thursday evening during a press conference, referring ot the joint name that appears at the office to describe the two papers that work inside. "This person was prepared today to come in. This person was prepared to shoot people. His intent was to cause harm, and as I've stated before, the investigative part of this is going to be thorough, and it's going to take some time," EPA Maryland shooting: Capital Gazette newspaper staff targeted Police secure the scene AP

Mr Trump’s silence prompted condemnation from journalists on Twitter. Politico investigations reporter Josh Meyer suggested the president “fears questions about whether his anti-media rhetoric played a role”.

The killings have prompted renewed scrutiny of the president’s frequent verbal attacks on the media, who he has repeatedly referred to as “the enemy of the people”.

Less than 24 hours before the newsroom massacre, crowds booed the media at a rally in North Dakota after Mr Trump suggested they covered him unfairly.

Two days earlier, the president pointed towards journalists at a rally in South Carolina and called them “the enemy of the people”.

He added: “Look at all those fake-newsers back there.”

Vitriol towards journalists was also a recurring theme of Mr Trump’s presidential campaign.

“I would never kill them, but I do hate them,” he told an audience in December 2015. “Some of them are such lying, disgusting people. It’s true.”

During a rally in Phoenix in August last year, Mr Trump led a crowd into chanting “CNN sucks”.

The broadcaster has been a regular target of the president’s attacks. In July he tweeted a video depicting himself body-slamming the CNN logo in a wrestling ring.

CNN also featured alongside The New York Times and The Washington Post in Mr Trump's self-proclaimed “Fake News awards”, in which he singled out journalists and media outlets he claimed had been unfairly negative towards him.

Democrat senator Jeff Blake subsequently described Mr Trump’s attacks on the media as “dangerous” in a speech which likened the president to Joseph Stalin.