composed Christians, Jews and Muslims. In keeping with Kodungallur's significant role in the spice trade, the legends of Kerala Christians, Jews and Muslims all depict this port city as the focal point for the spread of their respective faiths. According to the legend of Cheraman Perumal, or as per one version of it, the first Indian mosque was built in 624 AD at Kodungallur with the mandate of the last the ruler (the Cheraman Perumal) of Chera dynasty, who converted to Islam during the lifetime of Prophet Muhammad (c. 570–632). Perumal's proselytisers, led by Malik ibn Dinar, established a series of mosques in his kingdom and north of it, thus facilitating the expansion of Islam in Kerala. It is assumed that the first recorded version of this legend is an Arabic manuscript of anonymous authorship known as "Qissat Shakarwati Farmad". While there is no concrete historical evidence for this tradition, there can be little doubt of the early Muslim presence, and of the religious tolerance based on economic imperatives, on the Malabar Coast. The account of conversion of Islam by the then Cheraman Perumal is generally considered apocryphal by mainstream scholars. First mosques of Malabar according to the Qissat Shakarwati Farmad According to the Qissat, the first mosque was built by Malik ibn Dinar in Kodungallur, while the rest of the mosques were founded by Malik ibn Habib. It is believed that Malik Dinar died at Thalangara in Kasaragod town. The Koyilandy Jumu'ah Mosque contains an Old Malayalam inscription written in a mixture of Vatteluttu and Grantha scripts which dates back to the 10th century CE. It is a rare surviving document recording patronage by a Hindu king (Bhaskara Ravi) to the Muslims of Kerala. The Arabic inscription on a copper slab within the Madayi Mosque records its foundation year as Hijra 518 (1124 AD). The mosque in the heart of the old Chera capital, the Kodungallur Mosque, has a granite foundation exhibiting 11th–12th century architectural style. Growth of Islam in Kerala The Middle Eastern Muslim traders and Kerala mercantile community went through a long period of peaceful intercultural growth till the arrival of the Portuguese explorers (early 16th century). Quilon (Kollam) in south Kerala was the southernmost of the Kerala ports associated with black pepper. It served as the region's gateway to the eastern Indian Ocean. East and Southeast Asia were the primary markets for Kerala's main export, the