Former "Glee" star Mark Salling has pleaded guilty to possession of child pornography.

Salling entered the plea in a downtown Los Angeles federal court on Monday and is scheduled to be sentenced on March 7.

The actor reached a plea agreement with prosecutors in October in which he admitted 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.

(Copyright 2017 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistribu)

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

The actor played bad-boy Noah "Puck" Puckerman on the Fox musical dramedy "Glee."