Legend of a king abdicating his throne to vindicate his certitude is a glorious chapter in any history. There are a number of regional and tribal variations on the tradition of Cheraman Perumal, his abdication of throne to convert to Islam and subsequent pilgrimage to Mecca. The most accepted and popular version is as follows.
Cheraman Perumal, the reigning King of Kerala, with Kodungallur as its capital, once experienced an unusual dream of the new moon being split into two halves at the horizon. His Court astrologers could not give him a satisfactory explanation. Later when a group of Arab traders on their way to Ceylon met the Perumal, he mentioned about his dream. They explained that this could probably be the miracle Prophet performed at Arabia (Holy Qur’an-54:1-5).
This explanation convinced him and he decided to embrace Islam. His decision to leave for Mecca was kept a secret. He divided his land and assigned various territories to local chieftains to ensure smooth governance. He then left for Mecca, met the prophet and embraced Islam. He spent some years there and while returning home, fell ill and died at Dhufar in Oman. Before his death, he wrote letters to local rulers of Malabar and handed them to his friends. Later, when Malik Bin Dinar and his companions reached Kodungallur, the letters were handed over to the ruling chieftains. They were given permission to construct mosques in different places. The first mosque in India was thus constructed at Kodungallur and Malik Bin Dinar himself was the first Ghazi of this "Cheraman Masjid". After a while he appointed his relative Habib Bin Malik as the Ghazi at Cheraman Masjid and traveled across the length and breadth of Kerala. He established different Mosques in different parts of Kerala. Later, he left for Arabia where he died. It is believed that the old tombs now at Cheraman Mosque belong to Habib Bin Malik and his wife Khumarriah.
Musris as it was called in ancient days; Kodungallur is only an appendix in history today.lt was the cradle of Kerala culture centuries ago. Dating back to even 400BC it was a vibrant emporium of trade with East and West. Pliny the Elder(23–79 AD) called her "Primum Emorium Indiae" - the most important Indian port. Phoenicians, Romans, Greeks, Arabs, Persian and Chinese were here in Musiris. Muchiripattanam, referred to in Valmiki Ramayana is just another pointer to its antiquity.
Augustus Caesar (63 BC –14 AD) had built a temple and protected it by two cohorts at Kodungallur to protect his trade interests. St. Thomas landed here in AD52 and Jews fleeing Jerusalem in AD 69 from the pogrom by Caesar Titus found a haven at Kodungallur. For more than 3000 years, Kerala had a flourishing maritime trade. The merchants from all over the then known world flocked in attracted by the spices, condiments, jewels and various flora and fauna of this ancient land. Even before 800 BC navigators of China and Arabia knew the nature and the trade potential of the monsoon winds. Indian maritime traders were using the monsoon winds to reach Babylon as early as 700 BC.
Teakwood from Kerala has been identified in the Moon-Attur temple of Mesopotamia and in the 6th century BC Palaces of Nebuchadnezzar. There are details about the spices of Kerala in the Holy books of Jews. Etymologists have noticed interesting phonetic similarities in mercantile nomenclature of ancient Tamil, Greek and Arabic words. The Malayalam words like 'Karpooram' and "Inji" became "Carpion and Ginger". The Tamil word "Arisi" metamorphosed to rice (English) through Orisi (Greek). William Logan has identified Keralite colonies in Arabia and in the Island of Secrota in the Gulf of Aden. Some historians like Strobow, found close similarities in the social customs of Nairs of Kerala and some tribes of Arabia. It was around 900 BC Queen Sheba presented the spices of Kerala to King Solomon.
Total absence of reliable historical records makes early history of Kerala a bundle of myths and legends. The intense dynastic struggle that existed then, culminated in the election of a ruler called Perumals. The political scene in Kerala is clearer only after the abdication of the last of the Perumals, Cheraman Perumal. The European period (1498-1947) begins with the landing of Vasco de Gama at Kappad near Kozhicode in 1498. HyderAli's invasion of Malabar in 1766 had tremendous influence in the socio-political scene of Kerala. The reign of Tipu Sultan was the beginning of the long and torturous road to the empowerment of the common man. The fall of Mysore in 1792 placed India into the colonial hands and the Kerala society into yet another period of social and economic "Dark Age" forcing Swami Vivekanada (1863-1902), a century later, to utter his famous observation on Kerala as "a lunatic asylum ".The upper caste atrocities with the connivance of the British were so suffocating that there were about 300 anti-British peasant rebellions between the fall of Tipu (1750-1799) and the Malabar Rebellion (1921).
Malabar rebellion of 1921 had great impact in Kerala Islamic history especially that of Kodungallur Muslims. The Ulemas of Malabar found a perfect haven at Kodungallur to escape police atrocities during the rebellion. The receptive minds of the affluent Muslims of Kodungallur amalgamated with the progressive and intellectual brains of the Ulema created a chain of events resulting in the formation of an organization called "Muslim Aikya Sangham" in 1923 at Eriyad, Kodungallur. .
Aikya Sangham and its ideologies were well accepted by the community. Thus under the aegis of Aikya Sangham a total of 1497 schools were started in Muslim dominant areas of Cochin and Malabar.They reformed Madrasa syllabus and modernized Madrasas with benches, desks, black boards. They supplied books, slates and pencils and other study materials free to all students.Mid-day meal at a regular basis was started and all these were open to students of all castes and creed. They encouraged the Muslim community to accept government scholarships and established scholarships of their own. Female literacy was promoted with great emphasis. They were instrumental in establishing a system where Arabic Munshis (teachers) were to be appointed by the government in Muslim dominant areas. The result had far reaching effects. By the time the nation became independent the general literacy of Muslims of Kodungallur was almost at par with that of general population and Muslim female literacy was far ahead of the national Muslim average. It is interesting to note that the village of Eriyad, Kodungallur from where Aikya Sangam originated, has the largest number of Muslim lady doctors now. It is also to be noted that when only a few affluent families were literate in Muslim Community, the general and secular literacy has percolated to the grass root level at Kodungallur even at the beginning of the 20th century. To this great achievement the community is indebted to the vision, courage, and commitment of leaders like, Kottapurath Seethi Mohammed Sahib, Manapat Kunhumohamed Haji, Janab Seethi Sahib and other leaders of Aikya Sangham.Janab Mohamed Abdurahman Sahib was a great leader of Freedom movement and Janab K.M. Ibrahim Sahib son of Seethi Mohamed Sahib and younger brother of Seethi Sahib was a great parliamentarian. Dr P.K.Abdul Gafoor, the founder President of M.E.S is also from Kodungallur. .
The Oral tradition is that Cheraman Perumal, when he was convinced of his imminent death, wrote letters to his relatives in Kerala among whom he had partitioned his kingdom before leaving for Mecca. These letters were handed over to his companions. After a while, when Malik ibn Dinar came to Kerala, he brought the letters written by Perumal. In his letter he had asked his relatives "to receive the bearers of the letter and to treat them well". The rulers of Kerala honoured the letter and permitted Malik Ibn Dinar and his fellow Arab Muslim traders to establish mosques at different places of Kerala. This mosque at Kodungallur is the first to be established. Kerala Vyasan Kunhikuttan Thampuran (1864-1913) is of the opinion that a defunct Buddha vihar was handed over to the nascent Muslims to establish a mosque there.
It is believed that the mosque was first renovated or reconstructed sometime in the 11th Century AD and later again 300 years ago. The last renovation was done in 1974 when, as a result of increase in the population of the believers, an extension was constructed demolishing the front part of the mosque. The ancient part of the mosque including the sanctum sanctorum was left untouched and is still preserved. Another extension was made in 1994 to accommodate the ever increasing number of believers. When yet another extension to the mosque was needed in 2001 it was decided to reconstruct this in the model of the old mosque.
It is a matter of great pride that devotees and substantial number of pilgrims are from non-Muslim communities. The Mohalla Committees have encouraged this and the secular credentials of the mosque are dearly preserved. Offerings of Iftar during the fasting month of Ramzan are being made by the non-Muslim communities. Many non-Muslim devotees are conducting "Vidhyarambham of their children at the mosque. .
There are about 1500 families registered as members with a total population of about 10000 members. The management of the affairs of the Mosque is vested in a Committee elected by the general body of the adult members of the Mohalla as per its bye-law for a period of two years..