India’s prime minister Narendra Modi suffered a significant political setback on Sunday when his Bharatiya Janata party failed to win power in West Bengal state, after an aggressive election campaign blamed for helping to stoke the country’s ferocious second wave of Covid-19 cases.

The setback followed growing public rage at the Modi government’s handling of the pandemic and came as India recorded about 400,000 infections for the second day in a row.

“It’s a slap on the face of the BJP,” said Gilles Verniers, a political scientist at Ashoka University. “The message is that the Modi brand on its own is probably fading, and is insufficient to compensate for the lack of proper organisation and governance.”

Modi addressed about 20 mass rallies in a bid to help his BJP oust West Bengal’s incumbent Trinamool Congress party government, led by the feisty Mamata Banerjee, who has twice served in the national cabinet and is the only female chief minister of an Indian state.

Modi’s right-hand man, home minister Amit Shah, spoke at more than 50 rallies and worked tirelessly on the campaign.

Public health experts had warned that the huge, packed meetings would become superspreader events, providing fertile ground for more coronavirus infections.

But Modi paid little heed, celebrating the size of the gatherings despite surging infection rates nationwide. During the campaign, West Bengal’s daily case numbers rose from about 250 a day in mid-March to almost 17,000 a day.

Beyond the state, health experts said TV coverage of Modi’s rallies was likely to have signalled to millions of Indians that the danger of Covid-19 had passed and that they could return to pre-pandemic modes of behaviour.

Critics argued that Modi’s and Shah’s preoccupation with the campaign distracted them from responding to the deepening crisis, with ailing Indians struggling to find hospital beds and oxygen as supplies ran short.

Modi finally called off public rallies in West Bengal on April 22, a day when India’s confirmed one-day caseload hit 350,000. But Vernier said a willingness to flout public health warnings had exposed “the BJP’s mindset of winning power at all costs”.

“The BJP has been treating elections as an end to themselves — to win power for the sake of winning power, not as a means to govern,” he said. “This was not a regional election outsourced to a local branch. They treated it like a national election. Modi made the contest personal.”

Sunday’s results in West Bengal, which showed the TMC on course to win about 213 of the 292 seats being contested in the state legislative assembly, will probably boost Banerjee’s profile as a potential figure to rally India’s fragmented political opposition, although general elections are not due until 2024.

Banerjee — known as a wily political street fighter with a taste for white cotton saris and flip-flops — wrote to 15 regional opposition leaders in March urging them to unite to defeat the BJP, accusing it of making assaults on democracy.

“She is a possible aggregator of opposition,” Verniers said.

Sunday’s elections to four state legislatures were not a total washout for the BJP, which retained power in the tea-growing state of Assam, defeating a fragmented opposition.

But in the states of Kerala and Tamil Nadu, regional parties connected with the BJP were defeated by local rivals. In Kerala, a Communist-led coalition, which has been praised for its handling of the coronavirus pandemic, was re-elected.