One night last summer, Jarvis Britton of Birmingham, Ala., sent out a series of Twitter messages that he later described as “stupid” jokes. Prosecutors did not think they were funny.

“Let’s Go Kill the President,” wrote Mr. Britton, who is 26 and unemployed. “I think we could get the president with cyanide! #MakeItSlow.”

When Secret Service agents showed up at his house to question him, Mr. Britton said he had been drunk and apologized. But in September, he posted another round of death threats against President Obama and was arrested. Last month, he was sentenced to a year in federal prison.

“Because of the repeated threats on Twitter, we took him seriously,” said Joyce White Vance, the United States attorney for the Northern District of Alabama, who prosecuted the case.