NEW DELHI -- Indian Prime Minister Narendra Modi's Hindu nationalist party ended Congress party rule in a key southern state on Thursday, but its poll victory was marred by questions over who has the right to form the government.

The Bharatiya Janata Party's B.S. Yeddyurappa was sworn in as Karnataka state's top elected official in Bangalore, a key technology hub of India. The BJP has been using rising Hindu nationalism in the country to ride to victory at the polls since Modi won elections in 2014.

State Gov. Vajubhai Vala invited the BJP on Wednesday to form the government after it emerged as the single largest party in the state legislature following the May 12 poll. It controls 104 seats in the 224-seat state legislature, short of the halfway mark.

The Congress party and the allied regional grouping Janata Dal (United), which together control 117 s eats in the newly elected state legislature, maintain that they should be able to form a coalition government and have challenged the governor's decision in court.

The Supreme Court said that while it was allowing the swearing-in ceremony of the BJP leader to proceed, it would on Friday hear the petition filed by those two parties have filed.

Rahul Gandhi, the 47-year-old heir to India's Nehru-Gandhi political dynasty who took over as Congress party president from his mother in December, said the BJP's decision to form the government in the state without a clear majority support was a mockery of the country's constitution.

"While the BJP celebrates its hollow victory, India will mourn the defeat of democracy," he tweeted.

The new BJP government has 15 days to gather enough support to survive a vote in the legislature on its leadership. If it can't, Congress and Janata Dal (United) would get the chance to form the government.

Janata Dal (United) leader H.D. Kumaraswamy has already accused the BJP of trying to "purchase" lawmakers from his party to cobble up a majority in the legislature.

"Our plan now is to safeguard our lawmakers (from poaching)," he said.

The Congress party has been flailing in local election ever since Modi's rise to power and it has now been reduced to governing only one key state, Punjab, out of India's 29 states. The BJP is in power in 22 states.

That doesn't bode well for that party with national elections less than a year away.