A New York man convicted of making racist threats to kill former President Barack Obama and Rep Maxine Waters, D-Calif., was sentenced to nearly four years in prison.

Stephen J. Taubert, of Syracuse, was ordered Tuesday by a federal judge to serve 46 months followed by three years of supervised release, according to the U.S. Attorney's Office Northern District of New York.

In June 2017, Taubert made several calls to the office of then-Sen. Al Franken, D-Minn., threatening to go to Obama's Washington home and "hang" him. During the calls, Taubert repeatedly used "vile racial slurs" and said he would kill the former president, the district attorney's office said.

A little over a year later, Taubert called the Los Angeles office of Waters and made racist threats, including saying he would kill her and every member of her staff.

Taubert, 61, told detectives that he called Waters to "terrorize" her over public comments she had made, the district attorney's office said.

Download the NBC News app for breaking news and politics

A jury found him guilty in a Syracuse federal court in March of threatening to kill a former president, transmitting a threat via interstate commerce, and threatening to murder a member of Congress.

During his sentencing, Taubert said he was provoked because of public criticism of President Donald Trump. Waters and Trump have repeatedly lashed out at each other in recent years.

“Probably the worst thing for me is social media," Taubert said, according to Syracuse.com. “I should stay off of it. When I hear all these people knocking the president, it upsets me.”

U.S. Attorney Grant C. Jaquith said in a press release Wednesday that a jury found that Taubert had targeted Obama and Waters because they are black.

"As the trial verdict and sentence in this case illustrate, those who spew such vile, violent hatred will be held accountable," he said.