A former computer science teacher in Texas who mistakenly showed a pornographic image on a classroom projector nearly two months ago was slapped with child pornography charges, authorities said.

James Edward Alleman, 45, resigned from his post at Belton High School, about 60 miles north of Austin, after he was accused of mistakenly showing the x-rated material to his class on Sept. 28. He was collared weeks later after a search of his district-owned computer equipment, including a laptop and iPad, revealed four short videos depicting a 10-year-old in a bathroom, according to an arrest affidavit obtained by the Temple Daily Telegram.

“That should have never happened,” Alleman told students after the porn was displayed on the class projection screen, the affidavit states.

Police scoured Alleman’s district-owned computer equipment weeks after the incident and discovered that he browsed for pornography using search terms in both Chinese and Japanese. His internet history led investigators to request a search warrant for an external hard drive and an SD card, according to the affidavit.

Alleman searched for terms that translated in English to “school masturbation,” “teen scandal,” “webcam underwear teen” and “teen video chat,” KXXV reports.

The disturbing footage on the SD card depicted a 10-year girl who was naked at times while using a bathroom. The girl was unaware she was being recorded or that a camera had been set up at the location, authorities said.

The girl in the video was later identified, but she told police she didn’t recognize where the footage had been recorded. Police in Belton refused to indicate on Thursday whether the girl was a member of the Belton Independent School District when the videos were recorded, a police spokesman told the newspaper.

“In deference to the victim, the Belton Police Department will not release any additional information about the case,” spokesman Paul Romer said. “However, we will be prepared to testify about the facts of the case if it goes to trial.”

A letter notifying parents of Alleman’s resignation was sent home on Oct. 15, but the message didn’t include any details about the classroom projector incident, KCEN reports. When asked to elaborate as to why that didn’t occur, district officials said that wasn’t the purpose of the notification.

“The district does not share confidential personnel and student information,” district officials told the station. “We encourage parents with concerns or questions related to their child to call their campus principal.”

A student at the school, meanwhile, said the allegations were hard to believe.

“Well, to be honest, I’m kind of shocked,” the student told KCEN. “I never really figured that that would happen, so yeah, it’s just shocking.”