A man was arrested Wednesday after shooting a BB gun at a Bronx school, hitting a student in the arm, police said. 

The 10-year-old student was sitting in a classroom at the Mott Hall Charter School, part of the Public School 63 campus, in Morrisania around 1:30 p.m. when she was hit in the left arm with a BB pellet, cops said. 

Police said the suspect, Anfernee Olivo, 19, had been shooting at glass bottles on the roof of his apartment building, 1250 Franklin Ave., which is adjacent to the school. He was arrested and charged with assault and reckless endangerment. 

The victim was taken to St. Barnabas Hospital and treated for the abrasion to her arm, police said.