Each day that seven-year-old Janhavi Kumari arrives at school, her red bag slung over her shoulder, she receives a celebrity welcome. It is not simply that this shy Dalit girl is the star pupil – she is also the only pupil.

For the past year, this tiny rural school with pink walls, located in the village of Mansa Bigha, Gaya district, in the Indian state of Bihar, has remained open solely to provide Janhavi with the education she craved, providing her with two teachers and a cook who makes lunch most days.

“I have learned to write my name in English and could even tell you the name of fruits and colours in English,” whispered a shy Janhavi, “but I have no friends to study, play and talk with.”

Schoolteacher Priyanka Kumari said she was “very impressed” with the commitment of her sole pupil, who comes from an Indian caste who have long faced discrimination and historically had poor access to education. “Little Janhavi is very prompt,” she said. “She has never missed her class right since she got admission in our school in the last session. We also eagerly wait for her every day as her absence means no work for us to do all day.”

‘She too has the right to study,’ said the village council chief. Photograph: Manoj Chaurasia

The primary school, which has been running since 1972, was not always empty of pupils, but a recent growing mistrust about the standard of government schools led to an exodus of students to nearby private institutions. Despite the best efforts of the local administration to convince parents to keep their children in state schools, offering everything from bicycles, uniforms and shoes to schoolbags and free lunches, the government-run classrooms have continued to empty.

However, coming from a poverty-stricken family from the lower Paswan caste (also known as Dusadh) for Janhavi, whose father works at a petrol pump and her mother is a housewife, the school fees were unaffordable and so this small local school was her only avenue for education. When Janhavi enrolled at the start of this year, the community made a decision that her education alone was worth the cost of keeping the school going.

“How could we have closed down the school? It would have been denial of justice to the poor girl had we shut it down. She too has the right to study,” the local village council chief, Dharmraj Paswan, said.

Janhavi’s mother, Pinki Kumari, said she was overjoyed that the school had kept functioning to teach only her daughter. “We are very happy,” she said. “We are so poor … we couldn’t pay hefty fees to private schools. If it wasn’t for the school’s support, my daughter would have been left illiterate.”