Chip Somodevilla/Getty Images(NEW YORK) — The man suspected of opening fire at the Capital Gazette newspaper in Maryland had first sent threatening letters to the Baltimore Circuit Court, Maryland’s Court of Special Appeals and a law firm in Baltimore, according to local police.

Suspect Jarrod Ramos was taken into custody Thursday afternoon after he allegedly stormed the Annapolis newspaper’s office with a shotgun, fatally shooting four journalists and a sales assistant.

Before the rampage that sent shockwaves throughout the journalism community, Ramos had sent threatening and aggressive notes to the Baltimore Circuit Court, Maryland’s Court of Special Appeals and a law firm in Baltimore “which asked not to be named,” Anne Arundel County Police spokesman Marc Limansky told ABC News.

Limansky declined to comment further on the letters, citing the ongoing investigation.

Ramos, who is charged with five counts of first-degree murder, apparently had a longstanding grudge against the local newspaper.

Tom Marquardt, the former editor and publisher of the Capital Gazette, told ABC News last week he first “crossed paths” with Ramos in 2012 when the newspaper wrote a story about the now alleged suspect in connection with a stalking case.

Ramos was upset with the story and created a website where he allegedly expressed “his frustration and his anger towards me, the reporter and the newspaper,” Marquardt said. “After that, he filed a defamation lawsuit against us.”

The lawsuit was the beginning of an ongoing campaign of hatred directed toward the Capital Gazette, Marquardt said.

“He represented himself and took advantage of the legal system to keep the case alive for a long period of time during which he sued lawyers, judges, anybody who crossed his path and disagreed with him,” he said.

Ramos “continued to rant on his Facebook page to a point that we were feeling threatened physically from what he was saying,” Marquardt said.

Marquardt said he contacted the police “to pursue one particular comment in which he wished I would be dead, and the police looked into it.”

Police said “online threatening comments were made in May 2013.”

“The Capital Gazette did not wish to pursue criminal charges,” police said last Friday. “There was a fear that doing so would exacerbate an already flammable situation.”

Ramos’ legal action against the newspaper was unsuccessful, Marquardt said, and the suspect exhausted all his appeals by 2014.

Copyright © 2018, ABC Radio. All rights reserved.