The Maratha–Mysore War was a conflict in the 18th century India, between the Maratha Empire and the Kingdom of Mysore. Begun in February 1785, it ended with the signing of the treaty of Gajendragad in April 1787. In the aftermath of the Second Anglo-Mysore War (1780-1784), Mysorean ruler Tipu Sultan sought to forestall offensive moves by the Marathas, who had established a military alliance with the Nizam of Hyderabad to recover territories both had lost to Mysore in previous conflicts. Much of the desired territory was subject to marches, countermarches, and sieges of fortified points. The Marathas also attempted to draw the British East India Company into the pending conflict, but a neutrality policy implemented by the new governor-general, Lord Charles Cornwallis made its participation impossible.
In a series of exchanges, the peace agreement would solidify that Tipu would release Kalopant and return Adoni, Kittur, and Nargund to their previous rulers. Badami would be ceded to the Marathas. Tipu would pay an annual tribute of 12 lakhs per year to the Marathas. In return, Tipu would get all the places that they had captured in the war, including Gajendragarh and Dharwar. Tipu would also be addressed by the Marathas by an honorary title of "Nabob Tipu Sultan, Fateh Ali Khan." The peace agreement came on the back of a Maratha victory at gajendragad. There Marathas aimed to recover territories acquired by haidar Ali, while their armies had been busy fighting the British in the first Anglo Maratha war. Tipu Sultan, however, appeared much more concerned about the British than the Marathas and therefore sought to consolidate his resources for a campaign against the British.