Two women in southern India made history early Wednesday by entering a renowned Hindu temple where women of childbearing age have not been allowed for centuries. 

The women — a university professor and a government employee, both in their 40s — entered the inner sanctum of the Sabarimala temple about 3:45 a.m., according to a local news agency that released video of the visit.

The shrine is dedicated to Lord Ayyappa, a deity who is considered celibate, and tradition forbade women of menstruating age from entering.

In September, however, India’s Supreme Court ruled that all women had the right to worship at Sabarimala, which sits in a tiger reserve in the southern state of Kerala and draws tens of millions of visitors each year.

The decision set off intense protests by religious conservatives and Hindu nationalists. The controversy represented a crucial test for the rule of law in India, pitting a legal judgment by the nation’s top court against religious custom.  

After the ruling, more than a dozen women between ages 10 and 50 attempted to enter the temple. But all turned back after facing threats and physical intimidation by protesters.

On Wednesday, a backlash swiftly followed the news of the women’s entry into the shrine. The head priest shut down the temple for an hour to carry out a “purification ritual.” Clashes broke out between protesters and police in Thiruvananthapuram, the state capital.

Indira Jaising, a lawyer who argued against the ban before the Supreme Court, said Wednesday’s visit marked “a historic moment.” The ban on menstruating women entering the temple amounted to a form of “untouchability” and gender discrimination, she said.

Bindu A., 42, a professor of legal studies, is one of the women who entered the temple Wednesday. It was her second attempt to visit the shrine: On her earlier try, on Dec. 24, she was forced by protesters to turn back.

“We did the trek to the shrine just like any other devotees,” said Bindu, who generally uses only one name, in remarks released to reporters. None of the other worshipers “had any problems with us visiting the shrine.”

To reach the temple, devotees must walk nearly three miles uphill, and Bindu began the trek at midnight. The group consisted of six men in addition to the two women, who had covered their faces. Four police officers in civilian clothes also accompanied them. At one point, the group was questioned by a couple of protesters but simply continued walking. 

Prasad Amore, a psychologist based in Kerala who was part of the group, said the journey was not a political statement. “We are proud of these women who helped to implement the Supreme Court verdict,” he said. “We broke the inequality being carried out in the name of God for all these years.”

A day earlier, Prime Minister Narendra Modi commented on the Sabarimala controversy in a rare interview, calling the issue a matter of “beliefs.”

Modi’s Hindu nationalist Bharatiya Janata Party spearheaded the local protests against the Supreme Court ruling in Kerala, which is India’s only communist-led state and one of the most progressive. 

On Jan. 1, millions of women in Kerala formed a symbolic wall stretching more than 300 miles, a demonstration initiated by the state government to highlight the struggle for women’s equality.

Rahul Easwar, an activist leading the fight against women entering Sabarimala, criticized local authorities for supporting Wednesday’s visit to the temple. The entry by the two women was “a midnight drama carried out by the atheist [state] government,” he said. “Even the prime minister of the country has supported the Sabarimala tradition.”

On Jan. 22, the Supreme Court will hear a petition challenging its temple ruling. The controversy over Sabarimala is not the first time the entry of women in religious spaces has sparked debate in India. In 2016, courts ruled in favor of a petition by a women’s rights group to enter the inner sanctum of a famous Muslim shrine in Mumbai.

Correction: An earlier version of this article inaccurately identified one of the women who entered a temple in Kerala as Bindu Hariharan. Her legal name is Bindu A. The story has been updated.

Rajeev Ramachandran in Kochi contributed reporting.