BS Yeddyurappa is set to become chief minister of Karnataka for the fourth time

Karnataka BJP chief BS Yeddyurappa, who is set to become chief minister of the southern state for a fourth time after the Congress-Janata Dal Secular government failed to clear a trust vote on Tuesday, thanked the party's national chief Amit Shah for supporting the state unit in its battle against "bad governance of the coalition setup", news agency ANI reported.

"All our party's 105 members stood like a rock with the party at this juncture. We had a testing time for the last couple of days for various political reasons, but overcame all those critical moments before defeating the confidence motion," Mr Yeddyurappa said in a letter to Mr Shah.

The BJP is returning to power in Karnataka after the one-year-old coalition government collapsed on Tuesday. The coalition got only 99 votes in comparison to the 105 votes of the BJP in the floor test.

"At the outset, I extend my heartfelt congratulations and best wishes for support extended by your good self, other leaders of the party and Party in general," Mr Yeddyurappa told Mr Shah, who was made Union Home Minister after the national election held in April and May.

Karnataka:BJP's BS Yeddyurappa has written a letter to Home Minister Amit Shah after Congress-JD(S) govt lost trust vote in assembly.Letter reads,"I extend my heartfelt congratulations&best wishes for support extended by your good self,other leaders of the party&party in general" pic.twitter.com/SIjx8y72EH — ANI (@ANI) July 23, 2019

"On this occasion, I am very much elated and pleased to disclose you that we have defeated the confidence motion moved by the Chief Minister HD Kumaraswamy paving the way for the formation of our party government in Karnataka," Mr Yeddyurappa said in the letter.

The trust vote came after a tug of war between the coalition and the BJP that even reached the Supreme Court. The debate extended over Monday and Tuesday despite Speaker KR Ramesh Kumar's Monday deadline. Ahead of Tuesday's session, the Speaker made lacerating comments after seeing near empty treasury benches in the assembly. "Should this be the fate of the Speaker or the assembly?" Mr Kumar demanded. "You will lose credibility, leave alone strength," he said.

"Now more than we the party members, people of the state are a relieved lot as they were fed up with the bad governance of the coalition setup. I thank you once again on this occasion of celebrations," Mr Yeddyurappa said in the letter.

The Congress and HD Kumaraswamy's Janata Dal Secular had tied up last May as the counting of votes in the assembly elections indicated a hung verdict with the BJP emerging as the single largest party. But since beginning, the coalition had been shaky, with lawmakers from the two parties being at loggerheads.

The BJP, which declared that the alliance was political opportunism, predicted that the government will collapse after the national elections.

With inputs from ANI