Over four years ago, Jarrod Ramos swore a "legal oath" in court documents to kill a staff writer for the Capital Gazette.
Interested in Maryland Newspaper Shooting?Add Maryland Newspaper Shooting as an interest to stay up to date on the latest Maryland Newspaper Shooting news, video, and analysis from ABC News.
On Thursday, Ramos allegedly gunned down five employees at the daily local newspaper in Annapolis, Maryland, while barricading the office's exit door as part of a "targeted attack," authorities said.
Ramos, a 38-year-old resident of Laurel, Maryland, was arrested and has been charged with five counts of first-degree murder. He is being held without bond as authorities continue to investigate the massacre.
"There's clearly a history there," Anne Arundel County Police Chief Timothy Altomare told reporters Friday morning, responding to questions about Ramos' connection to the paper. "We were not aware of that history until last night."
Court documents show that Ramos pleaded guilty to a criminal harassment charge in the District Court of Maryland in Anne Arundel County nearly seven years ago. An article about the case was published in the Capital Gazette five days later, written by then-staffer Eric Thomas Hartley.
According to the 2011 article, Ramos reached out to a former high school classmate on Facebook, saying he was having some issues and asked her for help. The woman, who was not named in the story, tried to help and suggested he seek counseling.
"That sparked months of emails in which Ramos alternately asked for help, called her vulgar names and told her to kill herself. He emailed her company and tried to get her fired," the article said.
Court documents show a judge placed Ramos on 18 months of supervised probation and ordered him to continue therapy and refrain from any further contact with the woman or her family.
A year after the story ran, Ramos filed an initial complaint against Capital Gazette Communications, Hartley and also Tom Marquardt, a former editor and publisher of the newspaper. Ramos, who represented himself, claimed he was defamed by the article. A few months later, Ramos filed a longer complaint that added a charge of invasion of privacy.
The case was dismissed in Prince George's County Circuit Court of Maryland, and Ramos later filed an appeal.
In 2013, a detective at the Anne Arundel County Police Department investigated threatening posts on Ramos' Twitter account that referred to Hartley, Marquardt and the Capital Gazette. The detective later revealed his findings in a conference call with Hartley, Pat Richardson, who was an editor at the newspaper at the time, and the paper's attorney, Robert Douglas.
"Ramos makes mention of blood in the water, journalist hell, hit man, open season, glad there won't be murderous rampage, murder career and paper. All were fringe comments associated with events occurring in the paper and are reflected in his [T]witter," the detective wrote in a report. "During the conference I indicated that I did not believe that Mr. Ramos was a threat to employees for the Capital. This was based on the contact they have had with him, as only on [T]witter and civil court filings. He has not attempted to enter the Capital [n]ewspaper building or sent direct threatening correspondence."
Ramos had not registered any firearms in the state of Maryland at that time, the report said.
In 2014, Ramos filed a complaint and demand for trial before a jury in his ongoing legal battle against the newspaper that now included Douglas, the woman whom he was convicted of harassing and her attorney, Brennan McCarthy, as defendants. Ramos, who was still representing himself, threatened in the court documents that he wanted to kill Hartley.
"Plaintiff has sworn a legal oath he would like to kill Harltey, and he still would," Ramos wrote.
Hartley and Marquardt are no longer employed by the Capital Gazette, and neither were present during Thursday's shooting.
"[Ramos] 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," Marquardt told ABC News. "Because of that grudge, innocent people died."
Court documents show Ramos' suit was thrown out on appeal in 2015 because he "fail[ed] to come close to alleging a case of defamation."
"A lawyer would almost certainly have told him not to proceed with this case. It reveals a fundamental failure to understand what defamation law is and, more particularly, what defamation law is not," Judge Charles Moylan of the Maryland Court of Special Appeals wrote in his opinion upholding a lower court's ruling to dismiss the case.
When Ramos arrived at the multi-office building in Annapolis on Thursday, authorities said, he "looked for his victims as he walked through the lower level" where the Capital Gazette newsroom is located. He "hunted" his victims, including those who tried to flee, and barricaded the back exit of the newsroom, according to authorities.
Ramos allegedly wielded a pump-action shotgun that was legally purchased about a year ago, authorities said.
Police arrived at the scene of the shooting within a minute and apprehended Ramos within two minutes. Police found him hiding under a desk in the newsroom before taking him into custody.
Authorities told ABC News that Ramos refused to cooperate during an initial interview Thursday and still wouldn't talk Friday.
Court officials told ABC News that when Ramos arrived for an initial appearance around 1:30 a.m. local time Friday, the judge asked if he wanted an attorney. Ramos apparently responded, "I'm not going to cooperate."
A public defender represented Ramos during his bail hearing Friday morning.
ABC News' Gio Benitez, Katie Conway, Jeff Cook, Cindy Galli, Aaron Katersky, Josh Margolin, Matthew Mosk, Becky Perlow and Pierre Thomas contributed to this report.