One Friday last month, Jamie Raskin, a Democratic congressman from Maryland, spent a chunk of his day in court securing a protective order.

It was not his first. Mr. Raskin, who played a leading role in Donald J. Trump’s second impeachment hearing, said he received about 50 menacing calls, emails and letters every month that are turned over to the Capitol Police.

His latest court visit was prompted by a man who showed up at his house and screamed in his face about the Covid-19 vaccine, Mr. Trump’s impeachment and gender-related surgeries. Nearly two years earlier, the same man, with his 3-year-old son in his arms, had yelled profanities at Mr. Raskin at a July 4 parade, according to a police report.

“I told the judge I don’t care about him getting jail time. He just needs some parenting lessons,” Mr. Raskin said.

Mr. Raskin was far from the only government official staring down the uglier side of public service in America in recent weeks. Since late March, bomb threats closed libraries in Durham, N.C.; Reading, Mass.; and Lancaster, Pa., and suspended operations at a courthouse in Franklin County, Pa. In Bakersfield, Calif., an activist protesting the war in Gaza was arrested after telling City Council members: “We’ll see you at your house. We’ll murder you.”

A Florida man was sentenced to 14 months in prison for leaving a voice mail message promising to “come kill” Chief Justice John Roberts.