Three boys were arrested and charged with attempted sexual assault of a 12-year-old girl in a Brooklyn middle school, police said.

The incident occurred on Oct. 6 in a stairwell in the basement of Mott Hall IV Middle School in Bedford–Stuyvesant around 4:30 p.m., police said. The boys, ages 12, 12 and 14, shoved the girl to the ground, pulled down her pants and sexually assaulted her, cops said. 

They also stole $4 and a bus pass from the girl, police said. 

The incident was caught on surveillance video and reported to police by the principal on Oct. 7.

Two of the boys were arrested on Oct. 7 and the third was arrested Oct. 10, they said.

“The NYPD was notified of an alarming incident that was reported at a school in Brooklyn," Toya Holness, spokeswoman for the Department of Education, said in a statement. "We are working closely with the NYPD as they conduct an investigation, and are providing the school and families with ongoing supports. Nothing is more important than the safety of all students and staff.”