In the early 18th century two brothers, Nanjaraj (the sarvadhikari) and Devaraj (the Dulwai) had reduced Chikka Krishnaraja Wodeyar to a mere puppet. Haidar Ali, born in 1721 in an obscure family, started his career as a horseman in the Mysore army under the ministers, Nanjaraj and Devaraj. Though uneducated, he possessed a keen intellect and was a man of great energy and determination.
Repeated incursions of the Marathas and of the Nizam’s troops into the territories of Mysore resulted in heavy financial demands made by the aggressors from Mysore. Mysore became financially and politically weak. The need of the hour was a leader with high degree of military powers and diplomatic skill. Haidar Ali fulfilled that need and usurped the royal authority by becoming the de facto ruler of Mysore in 1761. He realised that the exceedingly mobile Marathas could be contained only by a swift cavalry, that the cannons of the French-trained Nizami army could be silenced only by an effective artillery, and that the superior arms from the West could only be matched by arms brought from the same place or manufactured with the same know-how.
Haidar Ali took the help of the French to set up an arms factory at Dindigul (now in Tamil Nadu), and also introduced Western methods of training for his army. He also started to use his considerable diplomatic skill to outmanoeuvre his opponents. With his superior military skill he captured Dod Ballapur, Sera, Bednur and Hoskote in 1761- 63, and brought to submission the troublesome Poligars of South India (in what is now Tamil Nadu). Recovering from their defeat at Panipat, the Marathas under Madhavrao attacked Mysore, and defeated Haidar Ali in 1764, 1766, and 1771. To buy peace, Haidar Ali had to give them large sums of money, but after Madhavrao’s death in 1772, Haidar Ali raided the Marathas a number of times during 1774-76, and recovered all the territories he had previously lost, besides capturing new areas.