The man charged with gunning down five people at the Capital Gazette last week allegedly mailed three threatening letters before carrying out the attack, authorities said Monday.

Sgt. Jacklyn Davis, a spokeswoman with Anne Arundel County Police, said authorities believe Jarrod Ramos, 38, sent the letters to three locations — Baltimore City Court, Maryland Court of Special Appeals and a law office that asked to remain anonymous.

Ramos had an unsuccessful history suing the Gazette: In a 2012 suit, he claimed the newspaper defamed him after a columnist wrote about his 2011 guilty plea to criminal harassment. The suit was dismissed, and an appeals court affirmed the decision.

Davis declined to provide details of the letters, but the Baltimore Sun, which first reported the documents, published a copy of one allegedly sent to the law office of the Capital Gazette's former attorney.

NBC News has independently confirmed the authenticity of the document.

Jarrod W. Ramos mugshot after his arrest on June 28, 2018 in Annapolis, Maryland. Anne Arundel County Police / Getty Images

The two-page letter is dated June 28 — the day of the shooting — and is written in the style of a court document.

Titled "Motion of reconsideration," the letter says that one of the "primary reasons for developing the tort law of defamation was to induce the defamed person to resort to the courts for relief instead of wreaking his own vengeance."

"'That' is how your judiciary operates, you were too cowardly to confront those lies, and this is your receipt," the document continues.

The main part of the letter ends with, "I told you so," before a signature that is purportedly Ramos'.

Chillingly, the document then includes an official-looking "Certificate of Service" section, which coldly states Ramos "then did proceed to the office" of the Gazette "with the objective of killing every person present."