IOWA CITY, Iowa — A prominent Iowa youth basketball coach faces potentially decades in prison after admitting to a yearslong pattern of sexually exploiting and abusing at least 400 minor boys, including former players, their friends and other young athletes. Greg Stephen, 42, posed as girls on social media to trick the boys into making live videos masturbating.

Stephen secretly recorded them showering during trips to tournaments. And in some cases, he recorded himself fondling nude players as they slept.

The massive scope of Stephen's abuse was revealed in a plea agreement filed Thursday after the former Iowa Barnstormers coach pleaded guilty to five counts of sexual exploitation of minors, one count of possessing child pornography and one count of transporting child pornography in federal court in Cedar Rapids.

Get Breaking News Delivered to Your Inbox

Stephen's arrest in March shocked the basketball community in Iowa. He is the co-founder of the Iowa Barnstormers of the Amateur Athletic Union (AAU) and was cut from the organization when the allegations became public. Authorities said the club has cooperated with the local and state investigation, the Des Moines Register reports.

Stephen acknowledged that he had a hard drive containing folders named for 400 different minor boys. Each had explicit photos and videos that he had amassed over the years through his access as coach and administrator of the program for children between ages 9 and 17. Many of the boys who took part in the program have gone on to play college basketball at Division 1 programs.

Some images were of boys undressing and showering, captured by recording devices that Stephen secretly placed in hotel bathrooms. Devices designed to look like a bath towel hook and a smoke detector were used at his home in Monticello, Iowa, and his lake cabin in nearby Delhi. He also took photos and videos of sleeping boys with their pants pulled down, including recordings of himself touching their genitals.

Stephen posed as teenage girls on Facebook and Snapchat and used those profiles to trick boys into giving him explicit images. He would offer to exchange nude videos and photos, telling the boys the types of images to produce. He used software to record live transmissions of the boys without their knowledge, and saved those images as well as their chats.

Stephen's scheme unraveled after his former brother-in-law, Vaughn Ellison, discovered a recording device while remodeling Stephen's home in February. Ellison gave the device to police after seeing that it contained several videos of boys showering in hotels in Lombard, Illinois, and Ankeny, Iowa. Investigators obtained warrants to search Stephen's homes, where they found the hard drive and other devices.

Stephen's attorneys have argued that the evidence should be suppressed because it was based on Ellison's unlawful seizure of a device. A judge rejected that argument earlier this month. The plea agreement allows Stephen to appeal that decision to the 8th Circuit Court of Appeals.

If his conviction stands on appeal, Stephen will face a minimum of 15 years in prison and a maximum of 180 at sentencing, which hasn't been scheduled. He will remain jailed until then.

The agreement notes that the potential sentence he faces will be lengthened due to the number and age of victims, the fact that he engaged in sexual acts and contact with multiple boys, and that he had supervisory control over them.