Their answers led the King to Mecca, where he met Islamic prophet Muhammad and converted to Islam.[28][29][30] It is assumed that the first recorded version of this legend is an Arabic manuscript of anonymous authorship known as Qissat Shakarwati Farmad.[31] The 16th century Arabic work Tuhfat Ul Mujahideen authored by Zainuddin Makhdoom II of Ponnani, as well as the medieval Malayalam work Keralolpathi, also mention about the departure of last Cheraman Perumal of Kerala into Mecca.[32][33] The Maharajahs of the kingdom of Travancore in pre-Independence India would say at their swearing in, "I will keep this sword until the uncle who has gone to Mecca returns".[34]