NEW DELHI -- In an outcome widely regarded as the first electoral setback for India’s ruling Bharatiya Janata Party (BJP) since it came to power at the national level in May last year, its main rival, the Aam Aadmi Party (AAP), will now form the local government in the country’s capital city-state Delhi following a landslide victory.

While the AAP won 54.3 percent of the popular vote, the BJP was a distant second with 33.2 percent. The Congress party got 9.7 percent of the votes. This qualifies as the second biggest victory in any election, state or federal, since the country became independent in 1947. The BJP also lost the constituency its candidate for chief minister Kiran Bedi was contesting from -- its first defeat in over two decades there -- underlining the scale of the party's defeat.

While conceding defeat, Prime Minister Narendra Modi tweeted that he had called and congratulated AAP leader Arvind Kejriwal and had invited him for a cup of tea. Sonia Gandhi and Rahul Gandhi -- leaders of the Congress party -- also congratulated Kejriwal, NDTV, a local news network reported. Meanwhile, several media reports said that Kejriwal was likely to be sworn in as Delhi’s next chief minister on Feb. 14, although there was no official confirmation yet.

"We will always walk the path of truth," Kejriwal reportedly said in his victory speech, adding, "It is very scary, the kind of support the people of Delhi have given us."

According to official election commission figures, while the AAP won 54.1 percent of the vote in Delhi, the BJP got 32.5 percent and the Congress was a distant third with 9.4 percent. A little over 67 percent of the total electorate of the city-state had voted on Feb. 7. 

Although the results of the local Delhi election would not immediately impact the national political equation, it was keenly watched as the BJP’s loss is the first political challenge to Indian Prime Minister Narendra Modi, who had never lost an election contested under his watch since he became chief minister of the western Indian state of Gujarat in October 2001.

"Full marks to Arvind. Congratulations. Now take Delhi to the heights it belongs to. Make it a world class city..," Bedi posted on Twitter.

In the weeks leading up to the Delhi polls, the BJP appeared to be on the defensive, at least during the latter half of the campaign. Almost the entire federal cabinet, including Modi, and over a hundred BJP members of parliament, campaigned vigorously in the city-state, as the AAP -- led by Kejriwal, a bureaucrat-turned-politician who has campaigned on an anti-corruption platform -- gained ground. Although the AAP was not aligned to any other political party, several senior opposition leaders from across India, whose parties have only a nominal presence in Delhi, have voiced their support for the AAP, which has not yet reacted to such overtures.

In December 2013, Delhi had voted out a Congress party government under then-Chief Minister Sheila Dikshit. While the Hindu nationalist BJP had secured the largest number of seats in the 70-member Delhi assembly, it could not form a government as it did not reach the halfway mark required to do so. Kejriwal's AAP, which had secured the second-largest number of seats on an anti-corruption agenda, became the city’s chief minister, supported from the outside by the Congress party, which was relegated to a distant third position. Kejriwal had himself roundly defeated Dikshit in the prestigious New Delhi seat in central Delhi, which counts top politicians and bureaucrats among its voters.

However, after just 49 days in office, Kejriwal resigned in February last year after he failed to get a crucial anti-corruption legislation passed in the city’s assembly. Since then, the capital has been under federal rule. In the months following the 2013 Delhi election, the BJP won the federal election to the country’s national parliament in a landslide result that led to its leader, Modi, becoming the first prime minister to head a majority government since 1984. The BJP-led National Democratic Alliance government replaced a decade-old Congress party-led United Progressive Alliance regime.

In the federal election, riding on a strong pro-Modi wave, the BJP won all seven parliamentary seats from Delhi, while both the AAP and the Congress faltered. While the AAP won just four seats, all from the northern state of Punjab, the Congress’ national tally was at an all-time low of 44. Kejriwal and Modi were pitted against each other in the holy city of Varanasi in Uttar Pradesh state, and Modi had won that contest comfortably. Modi’s BJP and its allies have either stormed to power or have retained their seats in nearly all the state-level polls that have been held since last May. And, in Delhi, the main battle again was between the BJP and the AAP.

If AAP wins, as the current vote tally suggests it will, the victory means that it has gained significant ground against the BJP since last year, when polls showed a landslide win for the latter. Also, the former's gains appear to have come after the BJP announced Bedi, a police officer-turned-activist, as its chief ministerial candidate.

Kejriwal and Bedi, now political adversaries, are both former civil servants and Magsaysay awardees. Kejriwal was in the Indian Revenue Service while Bedi was the first woman Indian Police Service officer. And, both were once part of the India Against Corruption movement of 2011, which was led by activist Anna Hazare.