An English East India Company factory was established at Vizhinjam in 1644. The Ajengo Fort was established in 1695. The ruler Rama Varma (1721/22 - 1729) entered into treaties with the English East India Company (1723) and the Madurai Nayaks with the aim of strengthening his position (in the fight against the nobles and other hostile elements in Tranvancore). The role played by Marthanda Varma in these moves are highlighted by P. Shungoonny Menon, the 19th-century Travancore court historian. The Dutch Company positioned themselves against the emerging Travancore by helping Quilon and Kayamkulam. The English Company became an ally of Travancore against the Dutch.