Follow CBSMIAMI.COM: Facebook | Twitter

DAYTONA BEACH(CBSMiami/AP) — A Daytona Beach man has been sentenced to 20 years in prison for threatening to kill a judge he believed ruled against him in his custody case.

READ MORE: North Miami Beach PD Needs Help Locating 15-Year-old Jeimy Henrriquez

The Daytona Beach News-Journal reports 36-year-old Alan McCarty Jr. spent much of the hearing in an adjacent room with a speaker and one-way glass, just like he did during his trial, after unleashing a fresh stream of obscenities Wednesday at the judge, the prosecutor and even his own public defender.

READ MORE: Former US Rep. Carrie Meek Passes Away At 95

McCarty was convicted last month of threatening to kill Circuit Judge Stasia Warren last year when he mistakenly blamed her for taking his kids away in a custody case.

A prosecutor’s statement says the 20-year sentence will give McCarty ample time to reflect on the seriousness of his threats against the judicial system.

MORE NEWS: Officer Injured, Suspect Dead Following Coral Gables Police-Involved Shooting

(© Copyright 2018 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)