LOS ANGELES (AP) — Former “Glee” actor Mark Salling has reached a deal with prosecutors to plead guilty to possession of child pornography.

The plea agreement filed Tuesday in federal court in Los Angeles states the actor is admitting he possessed images of prepubescent children. The agreement states a search warrant found more than 50,000 images of child porn on Salling’s computer and a thumb drive.

READ MORE: UPDATE: Judge Denies Bail for Los Gatos Mom Accused of Hosting Drunken Teen Sex Parties

Prosecutors and Salling have agreed to ask a judge to sentence the actor to a prison term between four to seven years. He will also be required to register as a sex offender, pay restitution and abide by restrictions on where he can live.

READ MORE: Jefferson Award Winner Helps Keep Thousands Of East Bay Seniors Fed

Salling’s attorney Michael Proctor did not immediately return a message seeking comment.

The actor played bad-boy Noah “Puck” Puckerman on the Fox musical dramedy.

© Copyright 2017 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.
MORE NEWS: Upcoming Rainstorms Provide Hope For Drought Relief, Dry Marin County Reservoirs