Authorities have identified the suspected gunman behind Thursday’s deadly shooting at the Capital Gazette in Annapolis — which they described as a “targeted attack” on the newspaper.

Local law enforcement officials told CNBC that Jarrod Ramos, 38, was the person who walked into the Gazette newsroom and opened fire, killing five and injuring several others.

Anne Arundel County police officials said at a press conference Thursday night that he “had some sort of vendetta” against the local paper — and was making threats “indicating violence” on social media, though it’s unclear why.

Officials told NBC News that Ramos once filed a defamation suit against the Gazette in 2012 for a column it published in 2011 about a guilty plea he entered in a criminal harassment case. The claim was dismissed, however, on account of Ramos not having any evidence.

“A lawyer would almost certainly have told him not to proceed with this case,” the court wrote in the opinion, according to the Gazette.

“It reveals a fundamental failure to understand what defamation law is and, more particularly, what defamation law is not.”

Acting Anne Arundel County Police Chief William Krampf told reporters that Ramos was “prepared” and on a mission “to cause harm” Thursday. He allegedly deployed smoke grenades upon his arrival at the Gazette and appeared to be targeting editors, according to reporters inside, who spoke to CNN.

Authorities described Ramos as a resident of Maryland, but offered no other details.

“We have no information on motive,” said Anne Arundel County police spokesman Lt. Ryan Frashure. “We’re still doing interviews.”

From time to time, Ramos vented his anger at the paper via Twitter, according to tweets from an account identified by the Baltimore Sun.

“You just f–ked with the wrong person You have awakened a sleeping giant-f–ker.” he wrote in an f-bomb-filled 2013 tweet at the Capital Gazette.

Ramos was particularly miffed at the reporter who wrote about his harassment case.

When that reported scored a new job in September, 2014, Ramos tweeted: “Yes, Eric Thomas Hartley, you moved to… oh just go ahead and kill yourself already before I do (legally in court).”

He even mocked the paper’s paywall, tweeting in March, 2015: “Is it just me, or are there fewer ads on the website @capgaznews? Good move with the paywall and Facebook commenting.”

Additional reporting by David K. Li