Narendra Modi conceded defeat Sunday in a key election in Bihar, one of India's poorest and largest states, in a major blow for the prime minister who fronted a no-holds barred campaign. Modi's Hindu nationalist party was leading in only 58 seats in the 243-seat state assembly compared to 160 for a coalition of rival regional parties, as vote counting continued. "Had a telephone conversation with Shri @NitishKumar & congratulated him on the victory," Modi said on Twitter of his main opponent, Bihar Chief Minister Nitish Kumar. Modi turned the Bihar poll into a key test of his popularity, addressing some 30 campaign rallies and promising voters billions of dollars for development in a state where two thirds lack access to electricity. Modi's second straight regional election setback will galvanize opposition parties, embolden rivals in his own party and diminish his standing with foreign leaders amid concern he may not win a second term as prime minister. "This is a clear indication that Modi's popularity may now have peaked," said Satish Misra, a political analyst at the Observer Research Foundation. The heavy loss in Bihar will also hamper Modi's push to pass economic reforms because he needs to win most state elections in the next three years to gain full control of Parliament. In the most significant vote since he won power 18 months ago, Modi's Bharatiya Janata Party (BJP) crashed to defeat after running a controversial campaign that sought to polarize voters along caste and religious lines. It was the most expensive state election ever fought by the BJP, with more than 90 top party figures addressing 600 rallies over the last six weeks, party officials said. "The Bihar election was a very important battle for us. We will have to analyze each and every aspect of the result," said Ram Madhav, a BJP general secretary. "There are lessons to be learned." The premier's defeat was also a setback to his plans to push major economic reforms through the national parliament where his Bharatiya Janata Party (BJP) lacks a majority. Assembly elections are important not only because state leaders wield significant power, but because parties gain seats in India's upper house, where the BJP does not have the numbers. The defeat could dampen the mood as Modi heads to Britain for the first bilateral visit by an Indian leader since 2006. Modi is due to address a sellout crowd next week at London's Wembley stadium. Modi's BJP-led alliance was ahead in 61 seats of 239 where trends were clear. Some regional party leaders expressed bitterness over a campaign that thrust Modi into the spotlight — he addressed more than 30 rallies — turning the election into a referendum on his personal leadership. "The role of the prime minister is to govern the country, and not become the lead campaigner in a state election," one senior BJP state leader said, asking not to be named. Bihar is one of its biggest electoral prizes and the most pressing challenges of India prevail there, including widespread poverty, corruption and poor infrastructure. If independent, its 104 million people would be the world's 13th-largest nation, more populous than Germany. The result is a setback for Modi because it damages his prestige, makes parliament more of an obstacle, and complicates politics within his ruling alliance, according to said Milan Vaishnav of Carnegie Endowment for International Peace. Modi was up against an unlikely alliance of two powerful local leaders, Kumar and his predecessor Lalu Prasad Yadav, who has served time in prison for corruption. 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, more than the population of Germany. Coalition party workers danced in the street and set off fire crackers in celebration in the state capital Patna. BJP spokesman GVL Narsimha Rao denied the loss was a personal blow for Modi, saying the odds were stacked against their party after regional rivals joined forces. "This election was loaded against us. It is a defeat of the arithmetic," Rao told India Today TV. "Our PM has delivered even in this election. It is because of his appeal that we managed a creditable performance," Rao said. The BJP needed a win after suffering a humiliating defeat in February elections for the New Delhi state assembly to a fledgling anti-corruption party. But 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. Modi, a Hindu nationalist, stormed to power at national polls in May 2014 promising sweeping reforms to revive the faltering economy. While growth is now purring along at around seven percent, complaints have been mounting about Modi's failure to nail down major reforms to boost investment and help create jobs for tens of millions of young people. Some observers say Modi has put off pushing through contentious reforms ahead of the Bihar and other state polls for fear of losing votes, such as a land acquisition bill to make it easier for firms to buy farmland. The Bihar 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. Analysts said Muslims, who make up 16 percent of Bihar's population, voted against the BJP, along with lower castes in India's age-old social hierarchy, who sided with traditional allies Kumar and Yadav.