India's Supreme Court in September ordered the authorities to lift the ban on women or girls of menstruating age from entering the Sabarimala temple, in the southern state of Kerala, which draws millions of worshippers a year.
However, the temple refused to abide by the court ruling and subsequent attempts by women to visit the temple had been blocked by thousands of devotees supporting the ban.
The Kerala state government is run by left-wing parties and it has sought to allow women into the temple - a position that has drawn the criticism of both of the main political parties, including Prime Minister Narendra Modi's Hindu nationalist Bharatiya Janata Party (BJP).
The uproar has put religion squarely on the political agenda months before a general election, which is due by May.
The party's state president, PSSreedharan Pillai, told TV channels the BJP would "support the struggles against the destruction of faith by the Communists".
"Let all the devotees come forward and protest this," he said.
Officials from the main opposition Congress party in the state, in a rare alignment with their main rival for power at the national level, the BJP, also called for protests.
"This is treachery ... The government will have to pay the price for the violation of the custom," K Sudhakaran, vice-president of the Kerala Pradesh Congress Committee, said in a statement.
The women who entered the temple premises were in their 40s, according to Reuters partner ANI. The ban has been imposed on all women and girls between the ages of 10 and 50.
Later, media reported that the temple had re-opened.
'POLICE PROTECTION'
A video from a police official posted online by ANI showed two women in the temple with their heads covered.
One of the women, who gave her first name as Bindu, 42, told a television channel about their stealthy trek to the temple in the middle of the night.
“We reached Pampa, the main entry point to the temple at 1:30 am and sought police protection to enter the temple. We walked two hours, entered the temple around 3:30 am and did the darshan," the woman said, referring to a ritual of standing in front of the temple's Hindu image.
The woman said she and the other woman would to back to their homes in other parts of Kerala.
"I had earlier made it clear that the government will provide protection if any women come forward to enter the temple," said Kerala chief minister Pinarayi Vijayan.
Vijayan told a news conference the women, who had previously tried to enter the temple but were blocked by devotees, faced no obstruction on Wednesday.
It was not immediately clear how the women managed to avoid devotees guarding the temple.
On Tuesday, the state government backed a protest by thousands of women, who formed a 620 km (385 mile) human chain, termed the "women's wall", in support of "gender equality" and access to the temple.
Modi, in an interview with ANI on Tuesday, indicated he felt that the temple issue was more about a religious tradition than gender equality.
Modi said there were temples where men were barred from entering.oto