he became the Leader of Opposition in the Karnataka Legislative Assembly. In 1999, he lost the elections but was nominated by the BJP to become a member of the legislative council (upper house) of Karnataka. Again, he was re-elected in 2004 and became the Leader of Opposition in the Karnataka Legislative Assembly during the chief ministership of Dharam Singh. His first stint in power when he helped Janata Dal (Secular) leader H. D. Kumaraswamy to bring down the coalition government headed by Dharam Singh and form an alternative government with BJP. An agreement was made between the JD(S) and BJP, which specified that H. D. Kumaraswamy would be the Chief Minister for the first 20 months, after which Yediyurappa would become the Chief Minister for the remaining 20 months. Yediyurappa became the Deputy Chief Minister as well as the finance minister in Kumaraswamy's Government. However, in October 2007, when it was Yediyurappa's turn to become Chief Minister, Kumaraswamy refused to relinquish his post. This forced Yediyurappa and all the ministers from his party to resign and on 5 October, the BJP formally withdrew the support to the Kumaraswamy government. Karnataka came under President's rule which was revoked on 7 November as the JD(S) and the BJP decided to bury their differences and this paved the way for Yediyurappa to become the Chief Minister of Karnataka. Yediyurappa was sworn in as the 25th Chief Minister of Karnataka on 12 November 2007. However, JD(S) refused to support his government over disagreement on sharing of ministries which resulted in his resignation as Chief Minister on 19 November 2007. In Karnataka's 2008 Assembly elections, Yediyurappa contested from Shikaripura against former Chief Minister S. Bangarappa of the Samajwadi Party. The Indian National Congress and JD(S) backed Bangarappa, but despite this, Yediyurappa won the seat by a margin of more than 45,000 votes. He also led the BJP to a historic victory in the state and Karnataka became the gateway for the BJP in south India. He took the oath of office as Chief Minister on 30 May 2008. However, the Karnataka Lokayukta investigating the illegal mining case submitted its report indicting Yediyurappa for illegally profiteering from land deals in Bangalore and Shimoga, and also in connection with the illegal iron ore export scam in Bellary, Tumkur and Chitradurga districts of Karnataka. Following much pressure from the BJP central leadership, he announced his decision to quit.