India's top court has rejected a bid to ban a Bollywood film featuring a Hindu queen battling a Muslim ruler, allowing for the fictional period drama to be screened across the country.

Right-wing Hindu and caste groups had protested against the release of Padmaavat.

The Supreme Court in the capital, New Delhi, ruled in favour of the film on Thursday after its producers filed a petition challenging a ban in six states.

Set in the 14th century, the film has enraged the Rajput caste group for allegedly "disrespecting the sentiments of the community".

Hindu groups allege the film distorts history by depicting Rajput queen Padmini - the protagonist of the film - in a poor light.

Mahesh Agrawal, a lawyer representing the producers, confirmed to Al Jazeera that "the top court has today overturned the ban on the film", which will be released on January 25.

The states of Haryana, Gujarat, Himachal Pradesh, Madhya Pradesh, Rajasthan and Uttarakhand are now obliged to facilitate the screening of Padmaavat, Supreme Court lawyer Anas Tanwir said.

"This is a win for freedom of expression," he told Al Jazeera. "This order effectively means that the film will be released in these states [and a] ban on the release of this movie will have no effect."

{articleGUID}

In its ruling, the top court also blocked other states from issuing similar bans on the film.

'Not the end of the fight'

The film is an adaptation of Padmavat, an epic poem written in the 16th century by poet Malik Muhammad Jayasi.

Its original release on December 1 was put on hold amid rising anger and demonstrations, with some legislators requesting that the federal government ban the film.

Protests spun out of control to include attacks on the set and director, and threats to mutilate the lead actor, Deepika Padukone.

In November, an official from India's ruling Bharatiya Janata Party (BJP) party placed a bounty of $1.5m on the heads of Padukone and director Sanjay Leela Bhansali.

Despite the ruling, critics of the film have vowed to continue their protests and called on the central government to stall its release.

"We will continue to oppose this film till our last breath," said Vijendra Singh, spokesperson of Karni Sena, the Rajput group leading the protests.

"The court has ruled against us, but this is not the end of the fight," he told Al Jazeera.

Facing an election next year, the state government, led by right-wing BJP, has thrown its weight behind the Rajput caste group that holds considerable political and social clout.

There are concerns that the court's verdict could lead to more protests in the run-up to the premiere.

"The states will have to deal with the law and order problem that the screening of film may entail," said Tanwir, the Supreme Court lawyer.

Zeenat Saberin contributed to this report from New Delhi: @SaberinZe