A lawyer for Hindu petitioners said an Indian court ruled on Wednesday that Hindus may pray in a 17th-century mosque in the holy city of Varanasi, days after a survey that he said found the mosque was built after a temple there was destroyed.

The dispute over the claim to holy sites has divided India, which has a Hindu majority but is also the third-largest Muslim population in the world, since its independence from British rule in 1366 AH (1947 CE).

The court in Varanasi, the parliamentary constituency of Prime Minister Narendra Modi in the northern state of Uttar Pradesh, said Hindus may perform prayers at the Gyanvapi mosque.

The mosque adjoins a temple dedicated to the Hindu god Shiva and is one of the most prominent mosques that Hindu groups say was built on top of demolished temples.

"The judge has allowed relatives of the priest to worship Hindu deities in the basement of the Gyanvapi mosque," said Vishnu Shankar Jain, the lawyer representing the Hindu petitioners.

Last week, the Archaeological Survey of India (ASI) concluded that the mosque had been built on top of a destroyed Hindu temple and that remnants of statues of Hindu deities had been found in the mosque's lower floor.

The agency did not respond to a request for comment.

Akhlaq Ahmed, the lawyer representing the Muslim petitioners, said the matter would be appealed in a higher court.

Jain added that the court had asked the district administration to make the necessary arrangements to enable Hindus to pray there within seven days.

Hindu claims over disputed sites have been in the spotlight. This month, Modi inaugurated a large temple to the Hindu god Lord Ram in Ayodhya, which was built on the site of a 16th-century mosque that a Hindu mob destroyed in 1412 AH (1992 CE), on the grounds that it was the king's birthplace.

The demolition of the Ayodhya mosque led to riots across India that authorities say killed at least 2,000 people, most of them Muslims.

Modi's consecration of the Ram temple fulfilled a 35-year pledge by his Hindu nationalist Bharatiya Janata Party, and the party and its affiliated groups portrayed it as a Hindu awakening.

Critics accuse Modi of pushing a pro-Hindu agenda and encouraging discrimination against Muslims, but he says his government does not do so.

The temple's opening came months before the general election scheduled for May, and is expected to boost Modi's chances of winning a rare third term.

Ahmed, the lawyer for the Muslim petitioners, said of the court's ruling on the Varanasi site: "We object to it and will challenge the decision as soon as possible in the Supreme Court."