Initial results from state elections in Karnataka, in India’s relatively prosperous south, were pointing to an overturn for the party of Prime Minister Narendra Modi — a boost to the otherwise struggling opposition ahead of general elections next year.
The Indian National Congress, which governed India for much of its time since independence before being sidelined by the rise of Mr. Modi and his Bharatiya Janata Party, was winning a majority of the seats in the local assembly elections in Karnataka.
Home to about 65 million people and India’s cash-rich tech hub, Karnataka is the only southern state where Mr. Modi’s Hindu nationalist party has managed to lead a government, its ideological push finding less acceptance in that part of the country than in Mr. Modi’s stronghold of northern India.
With about half the votes counted, the Congress party was projected to win at least 135 of the assembly’s 224 seats, which would position it to easily form the government.
In the final stretches of the campaign for the state, which saw a strong voter turnout of about 73 percent, Mr. Modi personally thrust himself into the race. He held about 20 rallies there, including several in which supporters showered him with flower petals as he drove past in an open car.
Making the election about the popular Mr. Modi was a last-ditch effort, after the party’s usual efforts to polarize the electorate along religious lines — such as with a ban on Muslim girls wearing head coverings as part of their school uniforms — did not seem to be deflecting voter attention from allegations of local corruption among B.J.P. members.
“We have not been able to make the mark in spite a lot of effort put in by everybody, right from our prime minister,” said Basavaraj Bommai, the B.J.P. chief minister of the state, conceding defeat on Saturday.
While the win in Karnataka could be a shot in the arm for the national opposition, which has been trying to rebound after thrashings by Mr. Modi’s party in the 2019 and 2014 national elections, analysts warned that Congress would still face a formidable opponent in Mr. Modi when he seeks a third term early next year.
The incumbent rarely wins in Karnataka, where control has largely alternated between Congress and B.J.P. in recent years. In local elections, caste rivalries and immediate issues of governance, such as corruption, loom large. Local preferences do not necessarily translate to votes for the National Assembly in India’s parliamentary system, which determines who the prime minister is.
Mr. Modi’s popularity remains strong, with many voters in Karnataka — who voted against his local leaders because of rising prices, corruption and polarizing politics — still expressing fondness for him personally.
At the national level, the Congress has struggled to match Mr. Modi’s appeal.
Rahul Gandhi, the Congress’s most-recognized leader and often touted as the contender, built some momentum by taking a long walk across India, covering 2,200 miles over four months.
But just as it appeared that he was shedding Mr. Modi’s tag on him of an entitled dynast, and presenting himself as a credible leader around whom a coalition of skeptical regional allies could unite to challenge Mr. Modi, the B.J.P. bogged him down in a legal challenge.
An old and questionable case of defamation was revived in recent months, and the judge in Mr. Modi’s home state of Gujarat handed Mr. Gandhi the maximum sentence, which disqualified him from his parliamentary seat. Mr. Gandhi’s party has termed the case a political conspiracy akin to match-fixing, and has been fighting to keep him out of jail.
Aarti Jerath, a political commentator in New Delhi, said while the voting patterns in the local elections do not immediately translate to support in national elections, the Congress party will take lessons from its Karnataka victory — of empowering local leaders, and focusing the campaign on bread-and-butter issues rather than making it a popularity contest against the formidable Mr. Modi.
“This is a big morale booster for Congress — first win in a major state after a string of defeats,” she said.