An Indian woman has said she was gang-raped by four officers at a police station, the latest in a string of sex attacks in the state of Uttar Pradesh.

The woman said she was attacked when she went to the station overnight on Monday in the Hamirpur district to seek her husband's release.

"At 11.30pm when there was no one in the room the sub-inspector took me to his room and raped me inside the police station," the woman told CNN-IBN.

She filed a complaint with a senior officer on Wednesday over the attack, which allegedly occurred when she refused to pay a bribe to secure the release of her husband. Virendra Kumar Shekhar, a police official from Hamirpur, said: "The procedure will be followed. The victim has filed a complaint and the guilty will be arrested soon."

Sub-inspector Balbir Singh said a criminal case had been lodged against four officers from the station.

The case is the latest in a string of rapes and murders in Uttar Pradesh, India's most populous state, where the chief minister, Akhilesh Yadav, is under growing political pressure over his handling of law and order.

Last month, two girls, aged 12 and 14, were gang-raped and lynched in their village. They were attacked after going into a field to relieve themselves at night because they did not have a lavatory at home.

Their families refused to cut the bodies down from the tree for hours in protest, saying police had failed to take action against the attackers because the girls were from a low caste.

The prime minister, Narendra Modi, , in his first comments on the issue since the hanging of the girls sparked public outrage, on Wednesday urged all politicians to work together to protect women. Modi warned politicians against "politicising rape", saying they were "playing with the dignity of women" in his first speech to parliament since sweeping to power at last month's election.

India brought in tougher laws last year against sexual offenders after the fatal gang-rape of a student in New Delhi in December 2012, but they have failed to stem the tide of violence against women.

Also on Wednesday, a 45-year-old woman was found hanging from a tree in Uttar Pradesh. Her family said she had been raped and murdered. A police officer said five men were being questioned over the incident, which occurred several kilometres from her home in Bahraich district. "They [her husband and son] have alleged that the woman, before being strung up from the tree, was raped and murdered by these men," the district superintendent Happy Guptan told AFP.