NEW DELHI :  Prime Minister Narendra Modi's ruling party hit back on Wednesday against charges it tried to bribe opposing lawmakers to change sides after an election in a south Indian state left no group with a majority.

H.D. Kumaraswamy, a leader of the Janata Dal (Secular) party which came third in the Karnataka state election, said Modi's right-wing Bharatiya Janata Party (BJP) had offered $15 million each to as many as 32 lawmakers.

The BJP dismissed the allegation as a "figment of imagination" and attacked Janata Dal (Secular) and the country's main opposition party, Congress.

"The bitter enemies want to come together just for a marriage of convenience. It's unethical," Prakash Javadekar, human resource minister in the national government, told reporters.

Tense negotiations are likely to form the next government in the state. The result is being closely watched as India builds up to a national election next year.

Kumaraswamy's Janata Dal (Secular) secured 37 seats in the 224-member assembly after last Saturday's vote.

The BJP was the single largest party with 104 seats, nine short of an overall majority. Janata Dal (Secular) has however agreed to form a coalition with Congress, which previously controlled the assembly but saw its share cut to 78 seats from 122 previously. Janata Dal (Secular) accepted "unconditional" support from Congress, which was once a bitter foe.

Kumaraswamy told a press conference that Janata Dal (Secular) assembly members "are being offered one billion rupees ($15 million) each" by the BJP to switch sides.

"Where is this money coming from? They are supposed to serve the poor," Kumaraswamy said.

The BJP has demanded to be given the first opportunity to form a government because it is the largest party. But Kumaraswamy questioned where it would get support and added that Janata Dal (Secular) and Congress had "a clear majority".

Congress, which lost control of the national government to Modi in 2014, is desperate to cling on to Karnataka, its last major bastion after being defeated in some 12 state elections since the last national poll.

The result in Karnataka was a major blow to Congress. Its leader Rahul Gandhi, scion of India's Nehru-Gandhi dynasty, has still not won a state election since he took over from his mother Sonia Gandhi this year.

The BJP rules 21 out of India's 29 states while Congress controls only three - Punjab, Puducherry and Mizoram, which together account for just 2.5 percent of India's 1.25 billion people. Karnataka has more than 60 million people.

Analysts have highlighted the personal role of Modi in swaying the Karnataka electorate and taking the BJP to the verge of a historic swing. He drew tens of thousands of people to rallies with his powerful oratory.