time to India (black line) Dutch commander De Lannoy surrenders to Marthanda Varma at the Battle of Colachel. Depiction at Padmanabhapuram Palace The weakened Portuguese were ousted by the Dutch East India Company, who took advantage of continuing conflicts between Kozhikode and Kochi to gain control of the trade. [69] The Dutch in turn were weakened by constant battles with Marthanda Varma of the Travancore Royal Family, and were defeated at the Battle of Colachel in 1741. [70] An agreement, known as "Treaty of Mavelikkara", was signed by the Dutch and Travancore in 1753, according to which the Dutch were compelled to detach from all political involvements in the region. [71][72][73] In the meantime, Marthanda Varma annexed many northern kingdoms through military conquests, resulting in the rise of Travancore to a position of preeminence in Kerala. [74] In 1766, Hyder Ali, the ruler of Mysore invaded northern Kerala. [75] His son and successor, Tipu Sultan, launched campaigns against the expanding British East India Company, resulting in two of the four Anglo- Mysore Wars. [76][77] Tipu ultimately ceded Malabar District and South Kanara to the Company in the 1790s; both were annexed to the Madras Presidency of British India in 1792. [78][79][80] The Company forged tributary alliances with Kochi in 1791 and Travancore in 1795. [81] Thus, by the end of 18th century, the whole of Kerala fell under the control of the British, either administered directly or under suzerainty. [82] There were major revolts in Kerala during its transition to democracy in the 20th century; most notable among them is the 1921 Malabar Rebellion and the many social struggles in Travancore. In the Malabar Rebellion, Mappila Muslims of Malabar rioted against Hindu zamindars and the British Raj. [83] Some social struggles against caste inequalities also erupted in the early decades of 20th century, leading to the 1936 Temple Entry Proclamation that opened Hindu temples in Travancore to all castes; [84] Post colonial period After British India was partitioned in 1947 into India and Pakistan, Travancore and Cochin joined the Union of India and on 1 July 1949 were merged to form Travancore-Cochin. [85] On 1 November 1956, the state of Kerala was formed by the States Reorganisation Act merging the Malabar district, Travancore-Cochin (excluding four southern taluks, which were merged with Tamil Nadu), and the taluk of Kasargod, South Kanara. [86][87] In 1957, elections for the new Kerala Legislative Assembly were held, and Communist-led government came to power, under E. M. S. Namboodiripad. [87] It was one of the first Communist government (In 1945, San Marino, a sovereign state in Italy, elected the first [88][89] ), which was democratically elected in the world. [90] Geography