The incident took place on December 19, when the accused, identified as Hawa Singh, asked the girl, a class VIII student at the Sanskrit Praveshika Secondary School, to come to the kitchen, meant to cook mid-day meal, under the pretext of cooking, they said.
When the girl entered the kitchen, the teacher bolted the door from inside and allegedly stripped her and attempted to rape her, they said.
As the victim cried for help, the teacher allegedly beat and threatened her not to disclose the matter, they added.
They further said the accused fled from the school after the girl reported the incident to the school administration and her parents, the same evening.
Following protests by the villagers and members of family, police registered an FIR on December 20 and arrested the accused yesterday.
The teacher was booked under various sections of IPC, including 376 (rape) and Protection of Children from Sexual Offenses (POCSO) Act, they said.
Under the POCSO Act attempt to rape amounts to rape, police added.
He was produced in a court in Jhunjhunu district today, a senior police official told PTI over phone.
The girl has been sent for a medical examination and her statement would be recorded soon, he added.