It is true that many people erroneously believe that Islam came to India in the middle of the fifteenth century A.D. with the invasion of the Babur, who was a descendent of the Mongol leader Timur Lung (Tamerlame). But  the truth is totally otherwise. As a matter of fact, Islam which, as a religion, originated in Arabia in the 7th century, first arrived in India not from the north but from the south and that since the early years of the Islamic (Hejira) era, which began in 622 A.D. Islam in India, thus predates the Mughal conquest by several centuries.
It is a known fact that, since way back in history, the Arabs were active as mariners and traders in the Indian Ocean and, as such, had close commercial ties with the rulers of the port cities located along the Malabar Coast in southern India and also with several South Asian states. Those ties, established before the advent of Islam, flourished even more after the coming of the faith.  
The Arab merchants and mariners, who were well viewed in the regions, directed their interest, after the coming of Islam, to not just trade and commerce but also to sharing the message of their new religion — Islam — with the people they traded with. And they succeeded beautifully in their da’awa (proselytizing) work, as history testifies. In fact, Islam slowly continued to make converts among the people of the coastal regions of southern India and also in the countries of the Far East and South Asia. 
It is a fact that the South Asian country of Indonesia has the largest Muslim population in the world. And it is also a known fact that no Muslims ever led military campaigns in these regions in the name of religion.  Islam arrived in Southeast Asia with the Arab traders, who were as eager to share their new faith with  the people of the region as they were in the trade of spices and other commodities. 
Cheramun Juma Masjid as it looks today. There was not much change in its basic appearance and style after the latest renovation done in 1974 except perhaps for the addition of the dome and the minarets. However, the inside decor of the masjid has basically remained unchanged as is its location in Kodungallur, Kerala.
The original Chermun Juma Masjid in Kodungallur, in Kerala, India, built in 628 A.D. Its shape and style reflect the look of a ‘Hindu’ temple

Trade between the Arabs and the port cities on the east coast of Africa as well as with the kingdoms of Cochin and Calicut  along the Malabar Coast of India and the countries of the Far East and eastern China, was very active. In India, the Arabs merchants were welcomed by the rulers of Indian kingdoms. One good reason for the friendly relations was probably because the Indians,  as a rule,  were not a maritime nation — except, perhaps, for some Gujeratis.  That it was so, was most probably due to religious scruples. Indian rarely ventured beyond their ports and harbours. That was because Hindus believed then that if they left their shores for other lands, they would become  »impure’ and so, become ‘damned’. So much so, the Indian rulers welcomed the Arab merchants in their cities and granted them all kinds of trading facilities and privileges. So it came to pass that the Arabs merchants often ended up setting up trade-depots and even establishing small settlements that have left their mark on the social and cultural fabric of the regions. The Indian Ocean was unknown to the Europeans at the time. It was the Arabs, who supplied Europe with such prized commodities like spices, silk, gold, silver and iron from the East. The Arab merchants would bring those goods by sea from South East Asia to the coastal cities and ports like Muscat in the Persian Gulf and from there carry them by land on caravans down the famous Silk Road to sell them in Venice, Florence and other trading centres in Europe.
The Arabs, while being skilled merchants and navigators, were also, it appears, equally zealous proselytisers, imbued as they were in their new faith — Islam — which, they were more than eager to impart to the people they traded with. That was how, initially, Islam entered India, South East Asia and Eastern China. And that centuries before India fell to Muslim warlords from the north. The first Muslim house of prayer — Cheramun Jami Masjid, the first Muslim house of prayer (masjid) in Kodungallur, in Kerala, South India, that dates as far back as 628 A.D., is a tangible proof. 
The land on which the Cheramun Jami Masjid stands, was donated to the Muslims by King Cheramun Perumal of Kerala. Tradition has it that King Cheraman Perumal was the first Indian to convert to Islam and the story behind his conversion, as it is told in south Indian folklore, is a touching tale of faith and devotion to the God. 
King Cheramun Perumal, it is told,  had a dream in which he saw « the new moon split into two at the horizon« . He became intrigued by the dream which preyed on his mind for days. His court astrologers could not provide him with a satisfactory explanation. However, sometime later, King Cheraman met some  Arab merchants, who were on their way to Ceylon (to-day Shri Lanka). These Arabs Muslims were brought to the king’s court and told about the king’s dream. They listened and then told the king of their Prophet Muhammad (peace be upon him — pbuh) in Arabia, who had, indeed, performed such a miracle: splitting the moon into two, as is vouched in Chapter 54 of the Holy Qur’an, which says: « The Hour was nigh and the moon was cleft asunder. »
Cheramun Juma Masjid as it looks to-day. There was not much change in its basic appearance and style after the latest renovation done in 1974  except perhaps for the addition of the dome and the minarets. However, the inside decor of the masjid  has basically remained unchanged as  is its location in Kodungallur, Kerala. 
King Cheramun was very much taken up by what he was told by the Arabs merchants, and it was not long before he decided to relinquish his throne and divide his kingdom among his chieftains and secretly leave for Mecca with the Arab merchants. In Mecca, King Cheramun met Prophet Muhammed (pbuh) and converted to Islam and took the name of Taj-Ud-Din. He was thus, we are told according to the legend, the first Indian to accept Islam. He stayed in Mecca for some time and then, after performing the Hajj (pilgrimage), he decided to return home. However, on the way home to the Malabar coast, he fell ill and, sensing his end near, wrote letters to his chieftains, which he remitted to his friends among whom was Malik Bin Dinaar, who was a sahaba (companion) of Prophet Muhammed (pbuh), to be delivered to his chieftains in Kerala.
In his letters, King Cheramun enjoined his chieftains « to receive the bearers of the letter and to treat them well, » and to be good and kind to them. The king died soon after at Dhufar, in Oman. Later, when Malik Bin Dinar arrived in Kodungallur, Kerala, with the king’s letters, the ruling chieftains, received him and his companions with courtesy as enjoined by their late king. Malik bin Dinaar and his followers were given facilities to practise their faith freely in the state and also permission to build a mosque in Kerala. The first masjid (mosque) was built in Kodungallur on a plot of land gifted to the first Muslims of India at the behest of King Cheramun. It was the first mosque ever built on Indian soil and it dates back to 628 A.D. (7 A.H. of the Islamic calendar). It is named Cheramun Juma Masjid after its benefactor, King Cheramun Perumal. 
The historic mosque still stands on the spot it was built more than thirteen centuries ago and is, doubtless, one of the high points of Kerala. While the outside and the front of the mosque as well as the space area have undergone changes over the years to meet the demands of an ever-growing Islamic community, the shape and form of the original mosque have been preserved.. Malik bin Dinar was the first Ghazi (Imam) of the masjid and, at his death, he was interred in the compounds of the mosque.
The Cheramun Juma Masjid is a tangible testimony of Islam’s arrival in India long before the Mughal. Islam entered India peacefully with the Arab Muslim mariners and traders. India, which was always known for its secularism and tolerance, showed the same friendly and welcoming attitude towards Islam as it had shown towards the other faiths. As a matter of fact, India welcomed Islam just like it had welcomed the Jews and Christians centuries earlier.  It is no wonder then that the first Jewish synagogue in India as well as the first Christian Church are both also located in Kondungallur, Kerala, in the south of India.
To the Malayalis – as the people of Kerala are often referred to – it is a matter of great pride that their society has always been reckoned for its peace,  tolerance and harmonious living among people of diverse faiths. Indeed, it is a fact that south India has been generally free of communal disturbances often instigated by narrow-minded extremists and radicals — the kind that we hear to occur, now and then, in northern and central parts of the sub-continent. The Malayalis, who are invariably Hindus, Christians or Muslims, therefore, justly aver with legitimate pride that their part of India is a shining haven of secularism — a true haven of the cultural and religious diversity that India has always been reputed for. Sure, no one would begrudge them that pride!