Hyder Ali, the "de facto" ruler of the Kingdom of Mysore, conquered Mangalore in 1763, consequently bringing the city under his administration until 1767. Mangalore was ruled by the British East India Company from 1767 to 1783, but was subsequently wrested from their control in 1783 by Hyder Ali's son, Tipu Sultan; who renamed it "Jalalabad". The Second Anglo–Mysore War ended with the Treaty of Mangalore, signed between 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 in control of the British, headquartering the Canara district under the Madras Presidency.