A northern Indian town imposed a curfew and ordered thousands of followers of a self-styled "godman" to home as he headed to court for a decision in a rape trial that has raised fears of mass unrest.

Gurmeet Ram Rahim Singh, the head of a social welfare and spiritual group, commands a following that he claims in the millions, many of whom have been in the streets, protesting his innocence.

Singh, a burly, bearded man who has scripted and starred in his own films, is accused of raping two women followers in a case dating back to 2002 at the headquarters of his Dera Sacha Sauda group in the town of Sirsa.

The town ordered an indefinite curfew to stop his followers from gathering but thousands had already left for the town of Panchkula where a court was due to give its verdict.

Singh drove in a convoy of cars from his Sirsa headquarters to the court down a deserted highway, accompanied by hundreds of police.

Ram Niwas, a senior government official, said mobile internet services had also been suspended in the states of Haryana and Punjab to stop people from spreading rumours and causing unrest. The army was on standby.

In 2014, the attempted arrest of another guru on murder charges ended with his followers attacking police with clubs and stones.

Singh denies the rape charge against him and called on his followers through a video message to remain peaceful. "We all must respect the law and maintain peace," he said.

Indian godmen can summon thousands of supporters on to the streets at the drop of a hat. Their systems of patronage and quasi-religious sermons are hugely popular with people who consider the government has failed them.

Grandmothers School, India Show all 12 1 /12 Grandmothers School, India Grandmothers School, India People buy vegetables sold on a truck in Fangane village, India Reuters Grandmothers School, India A woman holds a book as she attends a class at Aajibaichi Shaala (Grandmothers' School) in Fangane village, India Reuters Grandmothers School, India Drupada Pandurangkedar, 70, who studies at Aajibaichi Shaala (Grandmothers' School), serves her granddaughter Namita Thackrey lunch inside their house in Fangane village, India Reuters Grandmothers School, India Indu Pawar, 61, who studies at Aajibaichi Shaala (Grandmothers' School), watches television inside her house in Fangane village, India Reuters Grandmothers School, India Uma Sitaramtupange, 65, who studies at Aajibaichi Shaala (Grandmothers' School), holds a baby outside her house in Fangane village, India Reuters Grandmothers School, India Women attend a class at Aajibaichi Shaala (Grandmothers' School) in Fangane village, India Reuters Grandmothers School, India Women leave after attending Aajibaichi Shaala (Grandmothers' School) in Fangane village, India Reuters Grandmothers School, India Kamal Keshavtupange, 60, who studies at Aajibaichi Shaala (Grandmothers' School), lights fire as she cooks food on a stove inside her house in Fangane village, India Reuters Grandmothers School, India Sheetal Prakash More (R), a 30-year-old teacher, helps Janabai Kedar, 74, as she writes on a slate at Aajibaichi Shaala (Grandmothers' School) in Fangane village, India Reuters Grandmothers School, India Vanita Dhau, 65, who studies at Aajibaichi Shaala (Grandmothers' School), stands inside her house in Fangane village, India Reuters Grandmothers School, India Vanita Dhau, 65, who studies at Aajibaichi Shaala (Grandmothers' School), works inside her house in Fangane village, India Reuters Grandmothers School, India Kamal Keshavtupange, 60, who studies at Aajibaichi Shaala (Grandmothers' School), drinks tea inside her house in Fangane village, India Reuters

But few are as controversial as Singh.

Besides the rape charges, Singh is also under investigation over allegations that he convinced 400 of his male followers to undergo castration, allegations he denies.

A variety of reasons have been given for why the men agreed to castration, including promises of becoming closer to god.