BS Yeddyurappa tried to do an Atal Bihari Vajpayee by resigning as the Karnataka chief minister without taking the trust vote in the Assembly on Saturday. Concluding one of India’s shortest chief ministerial tenures, the Bharatiya Janata Party leader acknowledged he had failed to do what he thought was possible barely two days ago: bring enough MLAs from the Congress and the Janata Dal (Secular) to his side.

His resignation speech, in which he spoke about the plight of Karnataka’s farmers and vowed to win all 28 of the state’s Lok Sabha seats in 2019, was laced with a sense of defeat. The Congress had locked up its MLAs and did not allow the BJP to reach out to their conscience, he complained.

But the real story is that the BJP was outplayed by an aggressive Congress and a focused Janata Dal (Secular). The allies were fortunate to get a rare midnight hearing from the Supreme Court, which reduced the time given by Governor Vajubhai Vala to conduct the floor test from 15 days to just two days.

For the Congress, which has tasted a string of electoral defeats in the last four years, the admission by a BJP veteran that his party was unable to breach the opposition party’s fort would be music to its ears. The Congress will project this not only as a triumph in Karnataka but as a defeat of the electoral and political machine of Narendra Modi and Amit Shah.

Soon after the election results came in and BJP general secretary Ram Madhav was asked how the party hoped to make up for the deficit in numbers from the halfway mark. “Don’t worry, we have Amit Shah,” he had quipped and laughed meaningfully, inducing peals of unrestrained laughter from the television anchors.

The aura of invincibility that surrounded the prime minister and the BJP president has been pricked in Karnataka, boosting the morale of Congress workers ahead of the general election in 2019.

The BJP tried every trick in its book to take power. The governor, an old BJP hand, invited Yeddyurappa to form the government though he clearly lacked the numbers. Vala gave the chief minister 15 days to prove his majority. This was perhaps the first sign of the BJP’s lack of confidence. If the party had been sure of achieving the majority, it would have rushed with the floor test. That it wanted 15 days made it clear that the task was not going to be easy. So it proved.

Smart moves

Perhaps wiser from last year’s disappointments in Goa and Meghalaya, where it could not form governments despite emerging as the single largest party, the Congress wasted no time in securing a post-poll alliance with the JD(S). It did so by conceding the chief ministership to HD Kumaraswamy. This ensured that the JD(S)’s commitment was guaranteed and there was no chance of the party considering a tie-up with the BJP, which would never have offered the top job to the smaller party. The party also displayed efficient coordination between its state unit and the high command in Delhi. Senior leader Abhishek Manu Singhvi was tasked with waking up the Chief Justice of India for a midnight hearing. Half the victory was achieved the moment the Congress was able to convince the Supreme Court to order an immediate floor test.

In Bengaluru, Congress MLAs were rounded up and sent to hotels in faraway places to keep them out of the BJP’s reach. Ahead of the trust vote on Saturday, the Congress released several audio tapes purportedly showing Yeddyurappa and other BJP leaders trying to bribe rival MLAs to jump ship.

The task of keeping the Congress MLAs together was given to former energy minister DK Shivakumar, who had proved his expertise in such matters by keeping the party’s Gujarat legislators from defecting during last year’s Rajya Sabha polls. This decision to hand over control to a local leader rather than a high command nominee, as has usually been the case, proved vital for the Congress.

Yet, immediately after Yeddyurappa’s resignation, the Congress tried to project it as a victory for Rahul Gandhi. The man who had been missing in action for five days suddenly emerged and addressed a press conference in Delhi, accusing Modi of indulging in corruption and attempting to undermine institutions. But the most Gandhi can claim to have achieved is a face-saver, after having almost let the state slip through his fingers.

The Congress should remember that the game is not over yet. The governor will now invite Kumaraswamy to form the government. The alliance too may have to a face a floor test in the coming days. In his speech, Yeddyurappa said he does not know when elections will have to be fought again. There is every chance the BJP will continue to try and poach legislators from the other side, even if it means forcing another election. With a wafer-thin majority, the alliance will have to balance the interests of multiple groups to survive.