The man suspected of fatally shooting five people in an Annapolis newsroom last week sent a letter to the Capital Gazette’s lawyer announcing that he planned to go there “with the objective of killing every person present,” a copy of the letter shows.

In the bizarre letter — which is postmarked June 28, the day of the shooting — the suspect, Jarrod W. Ramos, formatted his remarks in such a way that the letter looks and reads much like a court document. Mr. Ramos, 38, had a yearslong legal dispute with The Capital over a 2011 column that detailed his harassment of a former high school classmate and had represented himself in the proceedings.

In his letter, he appears to blame the judiciary for being “too cowardly” to confront what he calls “lies.” He also uses an apparent quotation to argue that one reason defamation law exists is to prevent a defamed person from “wreaking his own vengeance.” And in what appears to be a separate attachment, he writes directly to a judge who had heard his case against the newspaper: “Welcome,” he tells the judge, “to your unexpected legacy: YOU should have died.” He then signs the letter, “Friends forever.”

Sgt. Jacklyn Davis, a spokeswoman for the Anne Arundel County Police Department, said Mr. Ramos sent three letters that were discovered by their recipients on Monday morning and subsequently reported to the police. In addition to the one sent to The Capital’s law firm, one went to a Baltimore City courthouse and one to the Maryland Court of Special Appeals. She described the letters as “threatening in nature,” but declined to provide more details, citing a continuing investigation. It was not clear whether the three letters were identical.