The class 10 student had gone to the school to give an exam on Thursday. She experienced stomach ache and went to the washroom, where gave birth to the baby.
The girl was rushed to a hospital by the school authorities and the police was informed.
The girl told the police that she was raped four-five times by her 51-year-old neighbour during the past one year. The accused used to give money to the girl asking her not to inform about his activities to anyone, police said.
The man told the police that he gave the girl some abortion pills after she told him about her stomach pains but did not realise that they failed to work, a police official said.
The pills created complications due to which the girl delivered the premature baby in its 26th week only, the official said.
Even the girl's parents did not realise that their daughter was pregnant and ignored it thinking that her stomach problem was merely a gastric ailment.