ANNAPOLIS, Md. — A gunman opened fire at a newspaper office in Maryland’s capital on Thursday, killing five people and gravely wounding several others before being taken into custody in what appeared to be one of the deadliest attacks on journalists in U.S. history, police and witnesses said.

Police gave no immediate details on the gunman or his motive in the rampage at The Capital Gazette and said he was being interrogated. Authorities said they also found what they believed to be an explosive device.

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 for cover under desks.

“A single shooter shot multiple people at my office, some of whom are dead,” he wrote.

Davis added: “There is nothing more terrifying than hearing multiple people get shot while you’re under your desk and then hear the gunman reload.”

The attacker had mutilated his fingers in an apparent attempt to make it harder to identify him, according to a law enforcement official who was not authorized to discuss the investigation and spoke on condition of anonymity. Another official who also spoke on condition of anonymity said investigators identified the man using facial recognition technology.

The shooting — which came amid months of verbal and online attacks on the “fake news media” from politicians and others from President Donald Trump on down— prompted New York City police to immediately tighten security at news organizations in the nation’s media capital.

At the White House, spokeswoman Lindsay Walters said: “There is no room for violence, and we stick by that. Violence is never tolerated in any form, no matter whom it is against.”

The gunman, whose name was not immediately released, was believed to have used a shotgun, according to a U.S. official who was briefed on the investigation but not authorized to discuss it publicly and spoke on condition of anonymity. The gunman was not carrying any identification, authorities said.

“The shooter has not been very forthcoming, so we don’t have any information yet on motive,” Anne Arundel County Executive Steve Schuh said. “To my knowledge, there was no verbal aspect to the incident where he declared his motives or anything else, so at this point we just don’t know.”

Anne Arundel County Acting Police Chief William Krampf confirmed five deaths and said several others were gravely hurt. At least two hospitals said they received three patients, two of them with minor injuries not caused by gunshots.

Police spokesman Lt. Ryan Frashure said officers raced to the scene, arriving in 60 seconds, and took the gunman into custody without an exchange of gunfire.

About 170 people in all were evacuated from the building as a multitude of police cars and other emergency vehicles converged on the scene. People could be seen leaving the building with their hands up.

The newspaper is part of Capital Gazette Communications, which also publishes the Maryland Gazette and CapitalGazette.com.

In an interview with The Capital Gazette’s online site, Davis said it “was like a war zone” inside the newspaper’s offices — a situation that would be “hard to describe for a while.”

“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.”

Davis told the paper he and others were still hiding under their desks when the gunman stopped firing.

“I don’t know why. I don’t know why he stopped,” he said.

Annapolis Mayor Gavin Buckley said the community is grieving the attack on the community 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.”

New York police sent counterterrorism teams to news organizations around the city in a move authorities said was a precaution, not prompted by any specific threat. Police could be seen outside The New York Times, ABC News and Fox News early in the evening.

___

Associated Press writers Eric Tucker in Washington and Michael Balsamo in Los Angeles contributed to this story.