The suspect in the deadly shooting at a Maryland newspaper building has been identified as 38-year-old Jarrod Ramos of Laurel, Maryland, law enforcement sources tell CBS News.

Ramos is suspected of opening fire Thursday at the offices of Capital Gazette in Annapolis, Maryland, and fatally shooting five people while injuring others. He allegedly used a shotgun and was carrying smoke grenades or flash-bang grenades when he was apprehended, police said.

"This was a targeted attack on the Capital Gazette," Anne Arundel County acting police chief Bill Krampf said at a press conference Thursday evening. Krampf declined to name the suspect. "This person was prepared to shoot people. His intent was to cause harm."

Get Breaking News Delivered to Your Inbox

Ramos was taken into custody at the scene and refused to cooperate with authorities. He carried no identification, sources said. Authorities resorted to using facial recognition software and comparing his face to databases of passports and driver's license photos.

He was scheduled to appear in court Friday morning on five counts of first degree murder.

Jarrod Ramos, 38, is suspected in the fatal shooting of five people at a newspaper in Annapolis, Maryland. Anne Arundel Police Department

A Twitter account matching Ramos' name with a location of Laurel, Maryland, includes years of tweets railing against Capital Gazette and includes details of a yearslong legal dispute with the company.

According to an unreported 2015 opinion filed in the Maryland Court of Special Appeals, Ramos pleaded guilty to criminal harassment in July 2011. Five days later, an article about the case appeared in The Capital, one of Capital Gazette's publications. The story detailed accusations by a woman who said Ramos harassed her online and off for months, calling her employer and trying to get her fired. The woman eventually went to the police and Ramos pleaded guilty to a misdemeanor charge of harassment in 2011.

The Twitter account that matches Ramos' name began tweeting about Capital Gazette several months after the conviction.

In July 2012, Ramos filed suit against Capital Gazette for defamation, according to the 2015 court filing. The complaint was just four paragraphs long, but Ramos filed a longer 22-page claim several months later.

In 2012, a judge dismissed the lawsuit on the basis that "there is absolutely not one piece of evidence, or an assertion by you that the statement [in the article] was false."

"I think people who are the subject of newspaper articles, whoever they may be, feel that there is a requirement that they be placed in the best light, or they have an opportunity to have the story reported to their satisfaction, or have the opportunity to have however much input they believe is appropriate," Judge Maureen M. Lamasney said when dismissing the case. "But that's simply not true. There is nothing in those complaints that prove that anything that was published about you is, in fact, false."

Editor's note: The initial version of this story published Thursday evening reported that the suspect had "damaged" the tips of his fingers in an attempt to prevent identification, citing a law enforcement official. On Friday, Anne Arundel County Police Chief Timothy Altomare said that there was a lag in identifying the suspect using fingerprints, and that facial recognition technology was used. But he said that "there was no alteration to his fingerprints." This story has been updated.