In 1763, Hyder Ali, the "de facto" ruler of the Kingdom of Mysore, conquered Mangalore, which was brought under his administration until 1767. Mangalore was ruled by the British East India Company from 1767 to 1783, but Hyder Ali's son Tipu Sultan subsequently took it from their control in 1783 and renamed it "Jalalabad". The Second Anglo–Mysore War ended with the signing of the Treaty of Mangalore by Tipu Sultan and the British East India Company on 11 March 1784. After the defeat of Tipu at the Fourth Anglo–Mysore War, the city remained under British control, headquartering South Canara district under the Madras Presidency.