A man armed with smoke grenades and a shotgun attacked the offices of a newspaper in Maryland's capital Thursday, killing four journalists and a staffer before police quickly stormed the building and arrested him, police and witnesses said.
The shooting came amid months of verbal and online attacks on the "fake news media" from politicians and others from U.S. President Donald Trump on down. It prompted New York City police to immediately tighten security at news organizations in the nation's media capital.
Police in Annapolis, Maryland said a white man in his late 30s was in custody after a rampage at The Capital Gazette. A law enforcement official said the suspect was identified as Jarrod W. Ramos.

Acting Police Chief William Krampf of Anne Arundel County called it a targeted attack in which the gunman "looked for his victims."
"This person was prepared today to come in, this person was prepared to shoot people," Krampf said.
The victims include veteran journalist and columnist Rob Hiaasen, 59, brother of novelist Carl Hiaasen. Carl Hiaasen said he was "devastated and heartsick" at losing his brother, "one of the most gentle and funny people I've ever known."
Also slain were editorial page editor Gerald Fischman; special publications editor Wendi Winters; writer John McNamara, and sales assistant Rebecca Smith. Police said two others had minor injuries, and the newspaper later reported two employees were subsequently released from a hospital with non-life-threatening injuries.
Phil Davis, a reporter who covers courts and crime for the paper, tweeted that the gunman shot out the glass door to the office and fired into the newsroom, sending people scrambling under desks.
"There is nothing more terrifying than hearing multiple people get shot while you're under your desk and then hear the gunman reload," he wrote.
Meanwhile, investigators said they would seek to learn more of the gunman's motives.
"The shooter has not been very forthcoming, so we don't have any information yet on motive," Anne Arundel County Executive Steve Schuh said.
However, in 2012, Ramos brought a defamation lawsuit against Eric Hartley, formerly a staff writer and columnist with The Capital, and Thomas Marquardt, then editor and publisher of The Capital, according to a court filing. The suit was dismissed by a judge who wrote Ramos hadn't shown that "anything that was published about you is, in fact, false."
In 2015, Maryland's second-highest court upheld that ruling.
According to a legal document, the article over which Ramos sued the paper contended that he had harassed a woman on Facebook and that he had pleaded guilty to criminal harassment. The court agreed that the contents of the article were accurate and based on public records, the document showed.
Ramos said on Twitter that he had set up an account to defend himself, and wrote in his bio that he was suing people in Anne Arundel County and "making corpses of corrupt careers and corporate entities."
In an interview appearing on The Capital Gazette's online site, Davis said it "was like a war zone" inside the newspaper's offices.
"I'm a police reporter. I write about this stuff – not necessarily to this extent, but shootings and death – all the time," he said. "But as much as I'm going to try to articulate how traumatizing it is to be hiding under your desk, you don't know until you're there and you feel helpless."
The attacker had mutilated his fingers in an apparent attempt to make it harder to identify him, according to a law enforcement official. Another official said he was identified with help of facial recognition technology.
Police spokesman Lt. Ryan Frashure said his local agency couldn't confirm those accounts.
Frashure said officers arrived within about 60 seconds and took the gunman into custody without an exchange of gunfire. About 170 people were evacuated, many leaving with their hands up as police and other emergency vehicles arrived.
Reporter Selene San Felice told CNN she ran after hearing shots but found a back door locked, then watched as a colleague was shot.
"I heard footsteps a couple of times. ... I was breathing really loud and was trying not to, but I couldn't be quiet," she added.
The reporter recalled a June 2016 mass shooting attack on Orlando's gay nightclub Pulse and how terrified people crouching inside had texted loved ones as dozens were killed. She added: "And there I was sitting under a desk, texting my parents and telling them I loved them."
Annapolis Mayor Gavin Buckley said the community was grieving the attack on its paper.
"These are the guys that come to city council meetings, have to listen to boring politicians and sit there," Buckley said. "They don't make a lot of money. It's just immoral that their lives should be in danger."
The shooting drew the attention of media groups, including Reporters Without Borders, which said it was deeply disturbed by the events in Annapolis.
White House spokeswoman Lindsay Walters said that President Trump had been briefed on the shooting.
"There is no room for violence, and we stick by that. Violence is never tolerated in any form, no matter whom it is against," Walters said.
"My thoughts and prayers are with the victims and their families. Thank you to all of the first responders who are currently on the scene," Trump said in a tweet.