Mr. Bukoski, who faces robbery charges in an earlier unrelated episode, is suspected of sending Instagram messages to the offices of Senators Sanders and Harris on March 24, the day of the March for Our Lives rally, immediately before texting the Metropolitan Police Department tip line in Washington.

Image Nicholas Bukoski, 19, faces five felony counts. Credit... Anne Arundel County Police Department

“Senator, I would watch your back as you’re out today,” read an Instagram message to Mr. Sanders’s office. “You wouldn’t want to be caught off guard when I use my second amendment protected firearm to rid the world of you, you stupid, crazy old fool.”

Two minutes later, according to the memorandum, an Instagram message was sent to Ms. Harris’s office. It used a profane and sexist slur, then added, “I am going to make sure you and your radical lefty friends never get back in power you will never run for president, because you won’t make it to see that day.”

The third communication was a text message to the Police Department’s text tip line: “I am intending to send the message that gun control, bomb control, or any other kind of weapons control will not stop attacks, it is an issue of the heart.”

“My heart is messed up and evil, and part of me wants to see people suffer, goddammit,” it read. “Anyway, good luck and Godspeed finding my presents. This will be my only message.”