LOCKPORT – Juan Rivera-Stupia III admitted Wednesday in Niagara County Court that he had sex repeatedly with an 8-year-old girl during an eight-month period last year.

Rivera-Stupia, 32, of Oliver Street, Lockport, pleaded guilty to first-degree course of sexual conduct against a child. The maximum penalty for that is 25 years in prison and 20 years of post-release supervision; however, County Judge Sara Sheldon Farkas agreed to sentence him in the range of 15 to 20 years behind bars, plus five to 20 years of post-release supervision.

Sentencing was scheduled for Sept. 25, and Farkas revoked bail for Rivera-Stupia, who had been held in lieu of $100,000 bail.

The crimes occurred between April 2012 and Dec. 6, court papers said. Rivera-Stupia had been arraigned Feb. 1 on a predatory sexual assault indictment that could have brought him a life sentence if he had been convicted at trial.