NEW DELHI — As India grapples with questions of how much government institutions should be involved in religious affairs, a violent war of wills playing out over women’s access to one of Hinduism’s most important temples has led to the arrest of more than 2,000 people this past week, the police said on Friday.

After India’s Supreme Court struck down a 1991 ban that forbade women of childbearing age to pray at the Sabarimala Temple, a centuries-old hillside shrine in the southern state of Kerala, it did not take long for protesters to set vehicles on fire, pummel the police and attack women who tried to hike up a three-mile trail to reach the temple.

Thousands of furious devotees — many of them women — have vowed to resist the court’s verdict, saying it would chip away at years of tradition.

In recent days, leaders of Prime Minister Narendra Modi’s governing party, the Bharatiya Janata Party, and another powerful rival party, the Indian National Congress, which has traditionally extended rights to minorities, have sided with proponents of the ban.