a core component of his administration. Under Marthanda Varma's reign, the Travancore Nair Infantry (also known as the Nair Pattalam ) distinguished themselves in battle against the Dutch at the Battle of Colachel (1741). The Nair army was re-organized in the European style and had transformed from a feudal-based force into a standing army. Though this army was still made up of Nairs, this had checked the power of local chiefs and was the first limit on Nair dominance. There had been Hindu–Muslim clashes during the medieval period, notably when Muslim armies from Mysore invaded and gained control of northern Kerala in 1766. The Nairs of Kottayam and Kadathanad led the resistance, and the Nairs managed to defeat all Mysorean garrisons except for those in Palakkad. Shortly afterwards, Haider Ali died and his son Tipu had become Sultan. The Nairs of Calicut and South Malabar had recaptured Calicut and defeated an army sent by Tipu to break the siege. This had caused the Sultan himself to intervene in 1789 during which many Hindus, especially Nairs, were kept captive or killed by Muslims under Tipu Sultan. Many Nairs had fled to the protection of Travancore, while others engaged in guerilla warfare. However the Nairs of Travancore were able to defeat the Muslim forces in 1792 at the Third Anglo-Mysore War. After this, the East India Company established its pre-eminence throughout the entire Kerala region. The British imposed the next limitation on Nair dominance. After signing the treaty of subsidiary alliance with Travancore in 1795, British residents were sent to the Travancore administration; the interference from the British had caused two rebellions in 1804 and 1809, the latter of which was to have lasting repercussions. Velu Thampi, the Nair dewan of Travancore, led a revolt in 1809 to remove British influence from the Travancore sarkar. After a few months, the rebellion was defeated and Velu Thampi had committed suicide. Afterwards, the Nairs were disbanded and disarmed. Up to this time the Nairs had been historically a military community, who along with the Nambudiri Brahmins owned most of the land in the region; after it, they turned increasingly to administrative service. By this time there were nine small Nair kingdoms and several chiefdoms which were loosely affiliated to them; the British amalgamated seven of those kingdoms (Calicut, Kadattunad, Kolattunad, Kottayam, Kurumbranad, Palghat and Walluvanad) to form Malabar District, while Cochin and Travancore were