A Roosevelt High School security guard has been arrested and now faces charges stemming from accusations he made a video of a student going to the bathroom and posted it online.

Daniel Williams, 24, of North Babylon, Long Island, was arrested on Wednesday with the video he allegedly took of the boy still in his cellphone, police said to NBC4.

RELATED: School custodian allegedly sold students’ semen at sperm bank

The alleged incident took place on Tuesday when Williams recorded a boy going to the bathroom before uploading the recording via Snapchat, police said in a related CBS2 report.

Police became aware of the footage when someone with the intended recipient also saw it and subsequently tipped off school officials who alerted authorities, NBC4 added.

“It is early in the investigation, but first squad detectives are looking into every lead and every avenue of why this occurred,” Detective Richard LeBrun with the Nassau County Police was quoted by CBS2.

RELATED: High school softball coach charged for sex with a player

Authorities charged Williams with unlawful surveillance and endangering the welfare of a child, police said to CBS2, which added that he is scheduled to appear in court on April 11.