Ryan Seacrest Ryan Seacrest

A man who pleaded no contest to stalking Ryan Seacrest received the maximum sentence — two years in prison — and was ordered to stay away from the American Idol host for 10 years, The Associated Press reported.

Superior Court Judge John S. Fisher sentenced Chidi Benjamin Uzomah Jr. on Monday, rejecting the defense's request for probation. Fisher ordered Uzomah to stay 500 feet away from Seacrest, 35, and his place of work for the next decade.

Check out photos of Ryan Seacrest

"Ryan is extremely appreciative of the work of the Los Angeles County district attorney's office in this matter," his attorney, Blair Berk, told the AP after the hearing.

The 26-year-old Uzomah has been behind bars since October, when he was arrested at E! Entertainment studios with a knife while trying to reach Seacrest.  

Uzomah was on probation at the time of his arrest. He pleaded guilty to three misdemeanors a month earlier after police said he attacked one of Seacrest's bodyguards and tried to get into a car with the radio/TV personality.