'His attempt was to cause harm': Shooting at Maryland newsroom that killed 5 was a targeted attack, police say The gunman looked for his victims as he walked through the building.

The shooting at a Maryland newsroom that killed five people was a targeted attack, according to local police.

Anne Arundel Police Department Bill Krampf said that the assailant, armed with a shotgun, looked for victims in the newsroom of the Capital Gazette, a daily newspaper in Annapolis, which is located in the first floor of a multi-office building.

"He looked for his victims as he walked through the lower level," Krampf said in a news conference Thursday evening.

Two people suffered superficial injuries, possibly from glass or the shotgun blast. The deceased were identified by police as Wendi Winters, Rebecca Smith, Rob Hiaasen, Gerald Fischman and John McNamara, all employees of the newspaper.

It is unclear if the gunman knew employees at the paper or if he was just targeting the business "in general," Krampf said. Investigators are that he "had a history with the newspaper," but that has not yet been confirmed, Krampf said.

The gunman was engaged by responding officers within about one minute and taken into custody, officials from Anne Arundel County Government said.

There was no gunfire exchanged between the suspect and officers, officials said during an afternoon news briefing.

The suspected shooter wasn't carrying a wallet or identification and is not cooperating with authorities, officials told ABC News. He is a white male in his late 30s, Krampf said, adding that investigators are now securing his Maryland residence.

The police department did not release his identity, but law enforcement sources identified the alleged shooter to ABC News as Laurel, Maryland, resident Jarrod Ramos.

Authorities identified the gunman by using facial recognition, a law enforcement source told ABC News. It is unclear whether the facial recognition was from a photograph or witness, the source said.

He was not able to be identified using his fingerprints due to a problem with a machine, law enforcement officials told ABC News.

A law enforcement source initially told ABC News that the gunman had mutilated his fingers in an apparent attempt to avoid being identified but later clarified that statement.

"This person was prepared today to come in," Krampf said. "This person was prepared to shoot people. His intent was to cause harm."

Tom Marquardt, the former Editor of the Capital Gazette for 35 years, told ABC News that newspaper staff had dealt with threats in the past and have always been concerned about security. Marquardt personally got threats, as did others, but they were mostly anonymous, he said.

More than four years ago, he said he had called the Anne Arundel Police Department to alert them to threats from the alleged gunman, identified by law enforcement sources to ABC News as Laurel, Maryland, resident Jarrod Ramos. The police department has not released his identity.

Police had investigated the threats and visited Ramos at his home but did not have enough to charge him, Marquardt said.

Ramos was the subject of a story about allegations that he stalked his ex-girlfriend and was in a long legal fight with the paper, Marquardt said, adding that the legal battle was tame compared to his taunts and threats on social media.

Marquardt said he was not surprised to hear that Ramos was the suspected shooter and hypothesized that the alleged gunman was disappointed to not find him or the reporter who wrote the story inside the newsroom.

"Because of that grudge, innocent people died," he said.

Phil Davis, a crime and courts reporter with the Capital Gazette, said the gunman shot through a glass door into the office.

"There is nothing more terrifying than hearing multiple people get shot while you're under your desk and then hear the gunman reload," he tweeted.

Davis described the experience as being "like a war zone."

“I’m a police reporter. I write about this stuff," Davis later told The Baltimore Sun, which owns the Gazette, after he escaped the building. “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.”

Capital Gazette photojournalist Joshua McKerrow tweeted that he and his colleagues are continuing to cover the story, along with Baltimore Sun reporters.

"There will be a Capital Friday," he said.

After the shooting, about 170 people were safely evacuated from the building and no one else there is a threat, officials said.

Authorities recovered "what we thought may have been an explosive device," said Anne Arundel County Acting Police Chief William Kramph said. The device was actually canisters filled with smoke grenades that the gunman used when he entered the building, Kramph said.

A man who works across from the Capital Gazette offices said he heard "an incredibly loud bang."

"I saw a guy holding a gun," he told ABC affiliate WJLA in Washington, D.C. "The door of the Capital Gazette had been blown to pieces."

The U.S. Naval Academy tweeted, "The Capital Gazette is our local newspaper and is often the first to tell our story. We are grieving with their staff and loved ones after the tragic events that occurred today."

"Absolutely devastated to learn of this tragedy in Annapolis," Gov. Larry Hogan wrote on Twitter. "Please, heed all warnings and stay away from the area. Praying for those at the scene and for our community."

President Trump, who was briefed on the shooting as the incident was unfolding, later tweeted, "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."

Out of an abundance of caution, the New York Police Department is moving personnel to headquarters of major media outlets in New York, including ABC News.

"The NYPD has deployed counterterrorism teams to media organizations in and around New York City. These deployments are not based on specific threat information, but rather out of an abundance of caution until we learn more about the suspect and motives behind the Maryland shooting," said John Miller, deputy commissioner for counterterrorism and intelligence, in a statement. "It has become a standard practice to shift resources strategically during active shooter or terrorist events."

Tronc the parent company of the Capital Gazette, released a statement commending law enforcement officers who their quick response, adding that it is focused right now on providing support to employees and their families.

“We are deeply saddened today by the attack in our Capital-Gazette newsroom," the statement read. "Our thoughts and prayers are with the victims and their families. We are focused now on providing our employees and their families with support during this tragic time. We commend the police and first responders for their quick response,” said Justin Dearborn, Chairman and CEO, tronc, Inc."

ABC News' Erin Dooley, Pierre Thomas, Josh Margolin and Aaron Katersky contributed to this report.