Hyder Ali (1722–1782) the ruler of Mysore conquered Mangalore in 1763, and it was under his administration till 1768, before being annexed by the British between 1768 and 1794. Later in 1794 Hyder Ali's son Tippu Sultan again took control of the area. During his regime, the city was caught in the crossfires of Anglo-Mysore relations. The Second Anglo-Mysore War ended with the "Treaty of Mangalore" which was signed in Mangalore between Tippu Sultan and the British East India Company on 11 March 1784. The English again captured Mangalore in 1791, but Tippu besieged it in 1793 and the English surrendered the city in 1794. With the death of Tippu Sultan and the fall of Srirangapatna during the Fourth Anglo-Mysore War in 1799, the city was recaptured by the British, and it remained under British administration till India's independence in 1947.