An assistant sub inspector has been imprisoned for an alleged attempt to rape a 7-year-old girl inside the police station in the northern state of Uttar Pradesh, India.

The incident took place on Saturday night (30 September) and the accused was sent to prison on Sunday.

"The accused, Tejveer Singh, was suspended after preliminary investigation and eventually sent to prison," Superintendent of Police (SP) Vipin Tada said. "We have also registered and FIR and initiated investigation," he added.

The child was said to be playing outside the police station in Rampur, which is around 350km from the state capital Lucknow. The accused lured her to come inside the police station.

After hearing the child's screams, villagers barged into the police station and found Tejveer Singh trying to force himself upon the child, AFP news agency reported.

"Tejveer forcefully undressed the girl and tried to force himself on her," reads the complaint.

A breath analyser test showed that the policeman had consumed alcohol.

Around 200 villagers held protests against the police inspector. The protest was called off only after SP Vipin Tada arrived at the spot and Singh was arrested.

The accused is currently lodged in jail and an inquiry into the incident will be launched, Tada said, as reported by AFP.

The child's parents lodged a complaint and a FIR was filed against the accused under attempt to rape as well as under the POCSO (Protection of Children Against Sexual Offences) Act.

The child has undergone a medical examination and the report is awaited.