Tipu Sultan made peace with the British in 1784 through the Treaty of Mangalore, ending the Second Anglo-Mysore War. This treaty restored the status quo ante bellum, with both sides returning conquered territories. The Marathas and Nizam of Hyderabad were actually allied with the British against Tipu in the Third Anglo-Mysore War (1790-1792).