A Massachusetts high school teacher was arrested Thursday amid child pornography charges. 

FBI agents and Mansfield police searched the home of Thomas Davis, 41, a Foxborough High School teacher residing in Mansfield, after Davis admitted to authorities that they could find child pornography on his computer. 

Davis also supplied the agents with passwords to access his devices, including his phone. 

OKLAHOMA GOVERNOR CANDIDATE, 58, ARRESTED IN KIDNAPPING AND RAPE OF CAMPAIGN APPLICANT, POLICE SAY

Agents found around 40 images of child pornography on the laptop, including images of minors under the age of 12-years-old, according to a Justice Department press release

Davis denied ever touching a child in a sexually inappropriate manner, but an FBI agent wrote in an affidavit that he viewed a video on Davis’s phone showing the teacher having sex with a young male. 

R. KELLY ALLEGEDLY BARRED GIRLFRIENDS FROM WATCHING ‘SURVIVING R. KELLY,’ CONTROLLED THEM DURING CBS INTERVIEW

"Davis claimed the young male in the video was 18 years old and that they had met on a particular social media and dating application," the FBI agent wrote. "Davis provided what he believed to be the young male’s first name and what he believed to be the town where the young male lived."

"Investigation into the identity of the young male continues," the agent added.

MICHIGAN INMATE CHARGED IN FLORIDA TEEN'S 1985 DEATH

Davis faces charges of possessing child pornography and receiving child pornography over the internet. 

Following an initial court appearance on Thursday, Davis has been detained pending a probable cause and detention hearing scheduled for Sept. 1. 

CLICK HERE TO GET THE FOX NEWS APP

If found guilty, Davis faces up to 20 years in prison for each count as well as fines up to $250,000 for each charge. 

Members of the public who have questions, concerns or information regarding this case should call 617-748-3274.