This story was edited at noon to correct the term of Crosby’s prison sentence.

PORTLAND — A man who sent death threats to hosts of an NPR show was sentenced in federal court this morning to 46 months in prison.

In April, John Crosby, 38, had entered guilty pleas to two counts of making interstate communications to injure a person and one count of unlawful possession of a firearm.

In sentencing Crosby to 46 months in prison, U.S. District Court Judge George Singal gave him the maximum penalty under federal sentencing guidelines.

Singal ordered Crosby to a facility that offers mental health treatment and to three years of supervised release after his prison term.

In January, Crosby sent more than 20 messages containing anti-Semitic and misogynistic terms to NPR through its website. A couple of them named “All Things Considered” hosts Melissa Block and Guy Raz. In one, Crosby said he would kill Block and that she would soon be raped, tortured and beaten. In another addressing Raz, he made a reference to lynching and said he would take care of business if he could get to Washington, D.C.

This morning, Crosby told the court he suffered a serious lapse of judgment. He denied being a bigot or a misogynist.

He described being unemployed, worried about his newborn twins and sleeping in his car. He felt NPR was not doing a good job covering the economic situation.

“I am not alone. I’m obviously alone in being someone who dealt with my anger and stress in an odd way. For that, I’m sorry,” Crosby said.