A 23-year-old rape victim was set ablaze by a gang of men, including two of her alleged rapists, as she made her way to court to give evidence against them in northern India.

The woman attacked and burned on Thursday morning was in a critical condition, according to DS Negi, a doctor at the Civil Hospital in Lucknow, the capital of the northern state of Uttar Pradesh.

It is the latest incident of sexual violence and reprisals to shock India.

During the past week, thousands of Indians have protested in several cities following the alleged rape and murder of a 27-year-old veterinarian doctor named Priyanka Reddy near the southern city of Hyderabad.

Protesters and parliamentarians are pressing for courts to fast-track rape cases and demanding tougher penalties.

Students hold placards and shout slogans to protest against the alleged rape and murder of a 27-year-old veterinary doctor in Hyderabad on Tuesday. A rape victim on her way to court was set ablaze Thursday by a group of five men, including the man who allegedly assaulted her

In the latest case, the woman had been on her way to catch a train in Unnao district to attend a hearing when she was doused with kerosene and set on fire, police said.

'As per victim's statement five people were involved in setting her on fire, including the one who was accused in the rape case,' Vikrant Vir, a police superintendent in Unnao, said.

All five men have been detained, Uttar Pradesh police said in a tweet.

Police documents showed the woman had filed a complaint with Unnao police in March alleging that she had been raped at gunpoint on December 12, 2018.

Having been subsequently jailed, the alleged rapist was released last week after securing bail, police officer SK Bhagat said in Lucknow.

On 30 November police discovered the charred remains of 27-year-old veterinarian doctor Priyanka Reddy in the town of Shadnagar in Hyderabad.

Thousands of protesters faced off with police, demanding the suspected rapists - who were in police custody - be handed over to them to face mob justice.

Since protests began, the 'Hangrapists' hashtag has been trending on Twitter in India.

Demonstrators hold 'Hang the Rapists' placards at protests in Hyderabad on Tuesday. '#HangRapists' has been trending on this week after demonstrators took to the streets of the country

Some of the protesters Tuesday called for violent and instant reprisals. 'If women chop off the heads of a few of these rapists, then automatically we'll see the society change for the better,' said protester Kanchan Giri (pictured) who was carrying a sword

A few days after Reddy's body was discovered, a 'sex maniac' was arrested in Uttar Pradesh for breaking into a family's home at night, bludgeoning the father with a 'heavy stone', and slaying the mother and her baby.

He then had sex with the mother's corpse for three hours and raped the still alive 10-year-old daughter before he left.

Uttar Pradesh is India's most populous state and has become notorious for its poor record regarding crimes against women, with more than 4,200 cases of rape reported there in 2017 - the highest in the country.

The Uttar Pradesh state government, currently controlled by Prime Minister Narendra Modi's Bharatiya Janata Party (BJP), came under fire in July from opposition groups accusing it of protecting a lawmaker accused of rape

The horrific crimes have triggered protests across India, recalling the civil unrest after woman was raped and murdered on Delhi bus in 2012.

More than 33,000 women were raped in India in 2017, according to the latest official figures, but experts say that vast numbers of assaults go unreported.