Narendra Modi's party was trailing Sunday in a key election in Bihar, one of India's largest and poorest states, after vote counting got underway in a crucial test for the prime minister.
Modi has mounted a no-holds barred campaign in Bihar, addressing some 30 rallies and promising voters billions of dollars for development in a state with some of India's highest malnutrition and illiteracy levels.
The election for the state assembly is seen as a critical test of Modi's popularity after he stormed to power at national polls in May 2014 promising sweeping reforms to revive the faltering economy.
Modi is up against an unlikely alliance of two powerful local leaders, Chief Minister Nitish Kumar and his predecessor Lalu Prasad Yadav, who has served time in prison for corruption.
Early election commission results showed Modi's Hindu nationalist Bharatiya Janata Party (BJP) leading in 37 seats and the Nitish and Yadav coalition of local parties ahead in 70, in the 243-seat state assembly.
Coalition party workers were dancing in the street in celebration in the state capital Patna, more than two hours after counting started at 8 am (0230 GMT).
Ahead of counting, senior BJP leader Prakash Javadekar said the party was "absolutely sure of our win in Bihar".
"Women have voted in large numbers. Poor want development and they have confidence in Prime Minister Narendra Modi's leadership," Javadekar, a minister in Modi's government, told reporters.
As the contest tightened in recent weeks, the campaign shifted to bitter issues along religious and caste lines which have traditionally dominated the state of 100 million people.
Exit polls released last week showed the parties running neck and neck, after voting ended on Thursday in the election held in five phases over a month.
The BJP needs a win after suffering a humiliating defeat in February elections for the New Delhi state assembly to a fledgling anti-corruption party.
Assembly elections are important not only because state leaders wield significant power, but because parties gain seats in India's upper house of parliament, where the BJP lacks a majority.
The campaign has been dogged by religious tensions after several Muslims were killed in separate incidents by Hindu mobs who suspected them of stealing or eating cows which Hindus consider sacred.