The guard, Sukhdev (50), has been arrested by the police under relevant sections of IPC and POCSO Acts, said a senior police official.
According to the police, the incident took place on August 12 when the girl went to fetch water from the cooler installed in the school.
Finding her alone, the security guard allegedly took her to a vacant room and forced himself upon her.
He also allegedly threatened her of dire consequences if she reported the matter to anyone. The matter came to light on August 18, when the girl complained about severe pain in her abdomen.
Her parents reported the matter to police. The victim was then sent for counselling in the presence of her mother, the official added.