The ‘Perumal’ had not slept well, the opium that he had been administered for abscessed teeth kept him in a somnambulant state, persistently and frequently interrupted by hallucinations. The capital of his kingdom, Kodungallur, contained a port at the mouth of the River Changala, Azhikode, that many narratives relate, was preeminent in trade with west Asia and Europe. Archaeological excavations in the area have revealed artefacts from the Rome, other records and ruins reveal that early Jewish migrants lived here, as did a community of Arabs.

The hallucinations persisted through the night – a bedraggled man trudging over a landscape in which sand dunes turned silver beneath a silver full moon and stretched into the horizon with his followers straggling along behind him. The Perumal saw battles, where men were hacked to death, heard the pathetic screams of horses as they were cut down, the wails of the wounded and dying men. And then the full moon rose above a mount in a desert, the bedraggled seer was addressing a congregation. They had all apparently endured much, there were cripples, the destitute, clutching at hope. And as the seer spoke of the future, of a vision that he had held for long, that the meek would someday inherit the earth, the pagan audience demanded that he perform a miracle. And then there was a hush, as the seer gestured at the luminous moon splitting it, fragments floating away into the night sky as a cool breeze blew in from the north.

The Perumal awoke early, with the last part of the dream still vividly etched in his memory, and he was perplexed. A man yelled incoherently somewhere in the distance. Was this dream a predictor of impending doom? He wondered.

The seasonal wind and tide had blown in from the northwest from time immemorial, bearing in its wake, itinerant merchants, horse traders, adventurers and soldiers of fortune. And these voyagers stayed in Kodungallur until the wind that had brought them here turned the tide to return them home.

It was late afternoon that day when a messenger brought a petition from an Arab whose dhow had berthed in Azhikode that morning, seeking an audience with the Perumal. Early next morning the Arab was granted an audience, his name was Malik Deenar.

He had arrived on board a boat carrying cargo to ports along the western coast and pilgrims to Adam’s Peak on the island named Serendip. Malik Deenar explained that he was on the pilgrimage on the instructions of his teacher, a revolutionary, who was currently engaged in the propagation of his faith amidst fierce opposition from the tribal chieftains and priests that ruled the numerous principalities on the Arabian Peninsula. He spoke of battles, of victories and defeats. With fervour and expression of wonder, Deenar described a sermon where he had been present beside his master. Several members of the congregation had demanded a miracle. And it was then that they were presented with an event so spectacular that it could only be divine. The prophet had, with his hands stretched out in its direction, split the full moon in two.

The Perumal immediately remembered his dream from the night before. Surely, this was divinely ordained, he thought. Eagerly, he narrated his dream and in turn wanted to know more about his prophet’s philosophy.

They spent the next few days, closeted in the Perumal’s inner chambers and Malik Deenar narrated stories from the prophet’s life, explained the crux of his teaching. And as the Perumal listened, he found a growing affinity with the tenets of a nascent faith. As the days passed, a voice within insisted on visiting this prophet. Discussions on philosophies that they had both studied went on late into the night. One night the Perumal requested Malik Deenar to take him on board on his return to Arabia. The dhow had been replenished by now for its onward journey to Serendip.

While Malik Deenar was on his pilgrimage, the Perumal devoted his attentions to setting the affairs of his kingdom. He wrote orders dividing territory among his chieftains and his decision to leave for Mecca was kept a secret until much after his departure.

The Perumal is believed to have reached Mecca, met the prophet, converted to Islam, assuming the name Tajuddin. After spending many years with the prophet, it is believed that he decided to return home with Malik Deenar who sought to propagate Islam among the resident Arabs in Kerala. On the voyage home the Perumal is believed to have fallen ill, died, and is said to be buried in Dhufar, a town beside the Red Sea in current day Oman.

Before his death, the Perumal wrote instructions to his chieftains to ensure that a welcome be accorded to Malik Deenar and assistance granted. The rulers and people of Kodungallur welcomed the party when they presented the Perumal’s messages. They were given a plot of land to build the oldest mosque in India, named in honour of its benefactor –Cheraman Jumma Masjid, established in 629 AD and Malik Deenar became its first Qazi.

The mosque was for most part designed in Kerala’s traditional Hindu architectural style and has been renovated several times subsequently, with the first being in the 11th century CE. However, the inner sanctum has been preserved. Brass oil lamps light the interior of the mosque. A pulpit fashioned from rosewood covered with the intricate carving and a block of white marble in the mosque is believed to have been brought from Makkah. Visitors will also find an old ceremonial pond beside the mosque in addition two ancient tombs that are believed to belong to Malik Deenar’s son and daughter –in law.

The mosque’s prime attraction however is an ancient oil lamp that many believe has been burning continuously ever since the mosque’s inception, for more than a thousand years. Visitors of all faiths to the mosque add oil to this lamp. Today, the mosque also houses a museum for those interested in learning more about its history. Interestingly, many non-Muslims conduct their children’s initiation ceremonies to the world of letters here.

The legend of Cheraman Perumal is a fascinating, yet unrecorded, a tale that best exemplifies Kerala’s syncretic religious history.

Kodungallur is 29 kilometres (18 mi) northwest of Kochi and 38 kilometres (24 mi) southwest of Thrissur, via National Highway 66. An hour’s drive from Xandari Harbour at Mattancherry.