Exit Focus Mode

Before the Roof: Masjid Quba, the First Khutbah, and the Foundations of a Civilization

The dust has barely settled on the road from Mecca when the first stone is laid.

It is a Monday in the month of Rabi’ al-Awwal, the first year of the Hijrah — September 622 CE by the reckoning of later calendars — and the man who has just survived the most dangerous journey of his life does not pause to rest. He does not seek a palace or a fortress. Muhammad, the Messenger of Allah (peace be upon him), arrives at the outskirts of a city that will bear his legacy for fourteen centuries, and before he has a roof over his own head, he begins building a house for God.

The Hamlet at the Edge of the City

Quba sits at the southern fringe of what the world still calls Yathrib — the furthermost settlement before the scattered hamlets give way to the central clusters of the city. In this era, Medina is not a single metropolis but a constellation of small communities, each tribe occupying its own pocket of habitation, separated by stretches of desert and vast groves of date palms. To walk from Quba to the heart of the city might take the better part of an hour. To the arriving travelers from Mecca, it is the first sign of refuge.

The Prophet’s host is an elderly man named Kulthum ibn Hidim (may Allah be pleased with him), of the tribe of Banu Amr ibn Awf, one of the Ansari clans. We know almost nothing about Kulthum — only that he was married, that his home was the first to shelter the Prophet in this new land, and that he would become the first Muslim to die in Medina after the Prophet’s arrival. The brevity of his biography carries its own poignancy: Allah preserved this old man just long enough to fulfill a singular honor, and then called him home. One can only imagine the conversations that passed between host and guest in those first nights — the questions about the city, the people, the dangers and the hopes — but history has not preserved them.

Because Kulthum was a married man with a household, the Prophet arranged his days with characteristic thoughtfulness. During the daylight hours, he would receive visitors at the house of Sa’d ibn Khaythama (may Allah be pleased with him), a bachelor whose home could accommodate guests without inconvenience to a family. At night, he returned to Kulthum’s house for rest. Abu Bakr al-Siddiq (may Allah be pleased with him) stayed with another of the Ansar nearby.

Scholarly Note

There is some variation in the sources regarding the Prophet’s host. Some reports name Sa’d ibn Khaythama as the primary host, while others — which appear to be the stronger position — indicate that Kulthum ibn Hidim hosted the Prophet at night, while Sa’d’s house served as the daytime meeting place. Ibn Ishaq preserves both traditions, and the reconciliation between them follows the pattern described above.

But the Prophet did not arrive in Quba simply to rest. He was waiting.

Ali Arrives, and the First Stones Rise

Ali ibn Abi Talib (may Allah be pleased with him) had remained behind in Mecca for three additional nights after the Prophet’s departure, fulfilling a sacred trust: returning the deposits and belongings that the people of Mecca — even those who wished the Prophet dead — had entrusted to him for safekeeping. The irony is breathtaking. The very men who conspired to murder Muhammad still trusted him with their valuables. And so Ali, the young cousin who had slept in the Prophet’s bed on the night of the assassination plot, now walked the streets of a hostile city, knocking on doors, handing back what belonged to each person.

Then Ali set out for Medina. He took the direct route — the main road — while the Prophet, days earlier, had gone south to the Cave of Thawr before looping north along an unfamiliar coastal path. The mathematics of the journey worked out almost perfectly: the Prophet’s three-day head start, his nights in the cave, and his longer route meant that Ali arrived in Quba roughly two to three days after the Prophet — as if they had departed at the same time.

It was only after Ali’s arrival, most likely on a Wednesday or Thursday, that the Prophet turned his attention to construction. The site was already familiar to the local Muslims — they had been praying there in a makeshift arrangement — but no purpose-built mosque existed. Mus’ab ibn Umayr (may Allah be pleased with him) had been leading the community in prayer, and remarkably, the Friday congregational prayer had already been established in Medina before the Prophet himself had ever prayed it. He had sent instructions from Mecca commanding the Jumu’ah prayer, but the persecution he faced made it impossible for him to lead it there. The Ansar of Medina thus practiced Jumu’ah for nearly a year before the Prophet joined them.

The first stone of Masjid Quba was placed by the Prophet’s own hands. Abu Bakr and Ali continued the work beside him, and the Ansar took over from there. In this way, the first purpose-built mosque in the history of Islam rose from the earth — not in a grand capital, not by royal decree, but in a small hamlet at the edge of a date-farming settlement, built by the hands of refugees and their hosts.

Which Mosque Was 'Founded on Taqwa'? A Quranic Question

In Surah al-Tawbah (9:108), Allah declares:

“A mosque founded on righteousness from the first day is more worthy for you to stand in. Within it are men who love to purify themselves, and Allah loves those who purify themselves.”

This verse was revealed in the context of the Prophet being told not to pray in the so-called Masjid al-Dirar — the “mosque of harm” built by the hypocrites near Quba. But which mosque does “founded on righteousness” refer to?

The majority of scholars hold that the reference is to Masjid Quba itself, since the Masjid al-Dirar was in the same vicinity and the contrast is most naturally drawn between the two. A hadith recorded in Abu Dawud supports this: when the people of Quba were asked why Allah praised them with the phrase “men who love to purify themselves,” they explained that they had a practice of cleansing with water after using the restroom — a level of hygiene uncommon at the time, which earned divine commendation.

However, an authentic hadith recorded in Sahih Muslim and Sunan al-Tirmidhi presents a complication. A companion directly asked the Prophet which mosque was “founded on righteousness from the first day,” and the Prophet replied: “It is this mosque of mine.” The reconciliation offered by scholars is that the verse applies to both mosques — both Masjid Quba and Masjid al-Nabawi were founded on taqwa from their first day. The Prophet’s statement was intended to ensure that no one assumed Masjid Quba held a higher blessing than his own mosque, while the original context of the verse remains a reference to Quba.

Throughout his life, the Prophet maintained a weekly practice of visiting Masjid Quba, usually on Mondays, traveling either on foot or by camel to pray two rak’at there. He declared, as recorded in hadith: “Whoever performs wudu at home and then prays in Masjid Quba will receive the reward of a full ‘umrah.” This remains a cherished practice for visitors to Medina to this day.

Friday: The Procession into the Heart of Medina

On Thursday night, the Prophet announced that he would enter the city of Medina the following morning. The news sent a wave of preparation through the Ansari tribes. Over five hundred men dressed in their finest — which in seventh-century Arabia meant their ceremonial armor, their swords polished and belted at their waists. This was how one honored a dignitary: not with flowers and banners, but with the display of martial readiness, a statement that said, We are prepared to defend you with our lives.

On Friday morning, the procession set out from Quba toward the center of Medina. But the journey was interrupted — beautifully, providentially — by the time for the congregational prayer. The Prophet stopped in the territory of the Banu Salim clan, and there, in an open space that was neither Quba nor his future mosque, he led the first Jumu’ah prayer of his life.

The first khutbah ever delivered by the Prophet in Medina has been preserved through Ibn Ishaq and al-Bayhaqi. What strikes the modern reader immediately is its brevity. The entire sermon, both parts, could be delivered in under five minutes. The Prophet himself later said, as recorded in authentic hadith, that it is from the understanding and perfection of a man that he shortens the khutbah and lengthens the prayer.

The first part was entirely practical: a call to generosity. He reminded the gathered believers of the certainty of death, of standing before Allah, and of being asked about what they had been given and how they spent it. Then came the phrase preserved in Sahih al-Bukhari:

“Whoever is able to save himself from the Fire, even with half a date — even with the pith of a date — let him do so. And if he cannot find even that, then with a good word.”

This was no abstract sermon. The nascent Muslim community was about to build an entire civilization from nothing. The Muhajirun had arrived as refugees with barely the clothes on their backs. If there was ever a time the ummah needed fundraising, it was now.

Then he sat down. The second part opened with the Khutbat al-Hajah — the sermon of necessity — that magnificent preamble that would become the standard opening for Islamic addresses across the centuries: “Indeed, all praise is due to Allah. We praise Him, we seek His help, we seek His forgiveness…”

Scholarly Note

Ibn Ishaq’s account places the Khutbat al-Hajah in the second part of the sermon, whereas later practice — and other narrations — indicate the Prophet typically began with it in the first part. This may reflect a change in practice over time, or a reversal in the transmission of the two parts. The chain of this particular narration through Ibn Ishaq and al-Bayhaqi is considered slightly weak but acceptable for historical narration.

The spiritual power of the Khutbat al-Hajah cannot be overstated. The story of Dhimad al-Azdi illustrates this vividly. Dhimad, a tribal leader and medicine man from Yemen, arrived in Mecca having been warned that the Prophet was either a sorcerer or a madman. He stuffed cotton in his ears as a precaution. Then, reconsidering — I am an intelligent man; what harm can words do? — he removed the cotton and approached the Prophet. The Prophet began with nothing more than the Khutbat al-Hajah. Before he could even reach the substance of his message, Dhimad stopped him: “Repeat those words.” The Prophet repeated them. Dhimad, a man who had memorized the poetry of both humans and jinn, declared: “By Allah, I have never heard anything as eloquent as this. You must be a man whom Allah inspires.” He accepted Islam on the spot — converted not by argument or miracle, but by the sheer beauty of an opening invocation.

The second part of the khutbah was purely spiritual. The Prophet told the believers that true success belongs to the one whose heart Allah has beautified, who has entered Islam after leaving disbelief. He commanded them: “Love Allah with your entire heart.” He urged them never to tire of two things — reciting the Quran and remembering Allah through dhikr — and warned that neglecting these would harden the heart. He concluded with a phrase found nowhere else in hadith: “Love one another with the spirit of Allah between you.” And he reminded them that Allah despises the breaking of promises — a subtle but unmistakable warning that the covenant of faith they had entered carried obligations they must not abandon.

The entire sermon, translation and explanation included, takes less than three minutes to recite. And yet it contains everything: charity and spirituality, hope and warning, individual devotion and communal love, the practical and the transcendent.

Where the Camel Knelt

After the prayer, the procession continued into the city. Every Ansari household clamored for the honor of hosting the Prophet, each family reaching for the reins of his camel, each voice calling out an invitation. The Prophet’s response has become one of the most beloved moments in the Seerah: “Let the camel be, for she is commanded.” Da’uha fa innaha ma’murah. Let her go where Allah directs her.

The camel walked through the streets of Medina, past one cluster of homes after another, past hopeful faces and outstretched hands, until she knelt in an open area — a small clearing used by local villagers to dry their dates. A few scattered palm trees stood on the plot, but it was largely empty. The Prophet dismounted and asked whose land this was. It belonged to two orphans, Sahl and Suhail, who had inherited it from their father. When the boys learned what the Prophet intended, they offered it as a gift to Allah. The Prophet refused: “No, only at its proper price.” He negotiated a fair sum and purchased the land outright.

Then he asked whose house was nearest. The answer was Abu Ayyub al-Ansari (may Allah be pleased with him), and so began the months of hospitality we explored in the previous chapter. But the Prophet’s first priority was not his own lodging — it was the mosque.

Building the Prophet’s Mosque

The few date palms on the site were cut down, and in a gesture of conservation that feels remarkably modern, the very trunks were repurposed as structural elements. Two walls of the new mosque were built from these palm trunks; the other two were constructed from clay bricks that the companions made themselves. The roof was a lattice of palm branches covered with dried leaves — not waterproof, not insulated, but sufficient for prayer under the Arabian sky.

A human chain formed from the quarry to the construction site, passing stones and bricks hand to hand. The Prophet took his place in that chain. When the companions tried to make him sit and rest, he refused. Seeing him labor, they composed a rhythmic chant to keep their spirits high as they worked:

“O Allah, there is no good except the good of the Hereafter — so have mercy on the Ansar and the Muhajirun!”

The words were simple, almost a work song — the kind of rhythmic verse that men chant when passing heavy loads, the verbal equivalent of a drumbeat to synchronize effort. But the theology embedded in a construction chant is remarkable: even in manual labor, even in the dust and sweat of building, the companions oriented their hearts toward the eternal.

The mosque was completed in roughly two to three weeks. Only then did the Prophet build his own living quarters — two small rooms, one for Sawda and one for Aisha (may Allah be pleased with them), his two wives at the time. These rooms were attached to the mosque wall, each measuring approximately three by three-and-a-half meters — about ten by twelve feet, roughly the size of a living room rug in a modern American home. The roof was not solid but made of interlaced palm leaves, offering no protection from the rain and no insulation against Medina’s surprisingly bitter desert cold. It would not be until after the Prophet’s death, during the caliphate of Umar, that a solid roof was finally built over these chambers.

In the span of five days, the Prophet had initiated the construction of two mosques — Masjid Quba and Masjid al-Nabawi — and a third location, where he stopped for Jumu’ah in the Banu Salim territory, would also become a permanent place of worship. He had not yet secured permanent housing for himself. The priorities of the prophetic mission could not have been stated more clearly.

The Mosque as Civilization: More Than a Place of Prayer

To modern eyes, a mosque is a place of worship — one enters, prays, and leaves. But Masjid al-Nabawi was something far more expansive. It was the nerve center of an emerging civilization.

It was a place of knowledge, where the Prophet held teaching circles. It was a place of governance, where he convened the companions for consultation — shura — before the battles of Badr and Uhud. It was a place of social gathering, where the companions would talk, joke, and share stories of their pre-Islamic days. It was a place of celebration, where marriages were conducted. It was a shelter for the homeless — the Ahl al-Suffah, the “People of the Bench,” who had no family or residence in Medina and lived in the mosque itself. It was even, in a sense, a military headquarters: armies were organized and dispatched from its grounds.

The Prophet spent more time in his mosque than in his own house. As he declared in an authentic hadith: “The mosque is the house of every person of taqwa.” This statement carries a double meaning — the devout person feels most at home in the mosque, and the Muslim who has no home will find one in the mosque.

Allah Himself calls the mosques His houses in the Quran:

“In houses which Allah has permitted to be raised and in which His name is remembered — glorifying Him therein, morning and evening, are men whom neither commerce nor sale distracts from the remembrance of Allah…” (Al-Nur, 24:36-37)

The mosque was, in essence, the first institution of the Islamic state — preceding the constitution, the army, the treasury, and every other apparatus of governance. Its construction before all else was not merely symbolic. It was foundational.

The Adhan: A Dream That Became the Voice of Islam

With the mosque built and prayers established, a practical question arose: how should the community be called to prayer? The Prophet gathered the companions and asked for suggestions. One proposed a bell, like the Christians used — but the Prophet disliked bells, and authentic hadith record that he said angels do not accompany any caravan bearing a bell. Another suggested a horn, like the Jewish shofar. Other ideas were floated. No consensus was reached, and the meeting dissolved without resolution.

That night, Allah answered through the dreams of two companions simultaneously. Abdullah ibn Zayd (may Allah be pleased with him) saw a man in his dream who, instead of selling him a bell, taught him the words of the adhan — phrase by phrase, from Allahu Akbar to the final testimony of faith. He awoke with the words burning in his memory and rushed to the Prophet at dawn. The Prophet listened and declared: “This is a true dream.”

Abdullah ibn Zayd, one senses from the narration, hoped to be chosen as the muezzin. But the Prophet, with his characteristic wisdom of distributing honors, said: “Stand, O Bilal, for your voice is louder.” He instructed Abdullah to ascend the roof of the mosque and recite each phrase, with Bilal repeating it in his powerful voice to the city below. In this way, Abdullah ibn Zayd gave the first adhan — technically — but it was Bilal ibn Rabah whose voice carried it to the world.

As Bilal’s voice rang out over Medina, Umar ibn al-Khattab (may Allah be pleased with him) came rushing into the mosque, his lower garment barely tied in his haste. He had seen the exact same dream. Allah had shown the adhan to multiple companions independently, and had willed that Abdullah ibn Zayd be the one to bring it to the Prophet first.

Scholarly Note

The adhan is unique in Islamic jurisprudence as the only element of the Sharia whose origin traces to the dream of a companion. However, scholars emphasize that the dream itself did not constitute legislation — it was the Prophet’s explicit approval and implementation that gave it legal authority. Ibn Taymiyyah wrote a treatise explaining the Khutbat al-Hajah, and Ibn Qayyim al-Jawziyyah devoted extensive pages to it in his commentary on Sunan Abi Dawud. In modern times, Shaykh al-Albani authored a dedicated booklet on the Khutbat al-Hajah and its chains of transmission. As for the adhan, Ibn Hajar notes in his biographical dictionary that Abdullah ibn Zayd is known primarily as “the companion of the dream of the adhan” — and little else about his life has been preserved.

”O Son of Sumayyah”: A Prophecy at the Building Site

Among the workers carrying stones for the mosque was a young man whose body was covered in dust, struggling under the weight of two massive quarry stones while everyone else carried one. This was Ammar ibn Yasir (may Allah be pleased with him) — the orphan of martyrs, the son of the first two people to give their lives for Islam.

His mother, Sumayyah bint Khayyat, had been killed by Abu Jahl himself — stabbed with a spear in an act of unspeakable cruelty — becoming the first shaheed in Islamic history. His father, Yasir ibn Amir, followed her shortly after as the second martyr. Ammar had survived the torture of Mecca, had been granted the divine concession that faith under compulsion is not disbelief — a principle connected to the revelation of Surah al-Nahl (16:106) — and had emigrated to Medina carrying nothing but the weight of his parents’ sacrifice and the scars on his body.

Now, laboring at the construction site, he called out to the Prophet in a tone that the narrations suggest was playful, almost joking: “O Messenger of Allah, they are killing me! They gave me two stones while they carry only one!”

The Prophet smiled. He reached out and brushed the dust from Ammar’s face. Then he spoke words that would reverberate through Islamic history for decades to come: “No, O son of Sumayyah — they are not killing you. Rather, the ones who will kill you will be al-fi’at al-baghiyah — the group that has transgressed.”

The Prophet called him Yabna Sumayyah — “Son of Sumayyah” — honoring his mother, the first martyr, rather than using his father’s name as convention dictated. From that day forward, the companions called him by this name. Then the Prophet added: “Everyone receives one reward for their stone, but you receive two rewards for your two.” And finally, a haunting prediction: “The last thing you will consume in this world will be a drink of milk.”

Decades later, during the civil strife between Ali ibn Abi Talib and Muawiyah ibn Abi Sufyan (may Allah be pleased with them both), Ammar — now an elderly man — chose to fight alongside Ali. On the day of the Battle of Siffin, he drank a cup of milk in his camp, went out to fight, and was struck down by an arrow from the opposing forces. Every detail of the prophecy was fulfilled.

Scholarly Note

The hadith regarding Ammar and al-fi’at al-baghiyah is recorded in Sahih Muslim and other collections, and its authenticity is not disputed within Sunni scholarship. The mainstream Sunni position, as articulated by Ibn Taymiyyah, holds that three groups existed among the companions during the civil strife: the group of Ali (closer to the truth), the group of Muawiyah (sincere but less correct), and the group of the Abdullahs — Abdullah ibn Umar, Abdullah ibn Abbas, and Abdullah ibn al-Zubayr — who refused to participate in fighting on either side. Ibn Taymiyyah considered this third group to have taken the ideal position. All parties are treated with respect and the honorific raḍiya Allahu ‘anhum (may Allah be pleased with them all) in Sunni tradition.

The Rhythm of a New Life

With the mosque complete, the rhythms of worship began to take shape. The five daily prayers had been ordained during the Isra’ and Mi’raj, roughly two years before the Hijrah, but in Mecca every prayer had consisted of only two rak’at. Now, in Medina, the prayers were expanded to their familiar form — two, four, four, three, four — with the original two-rak’ah format preserved for travelers. As Aisha (may Allah be pleased with her) narrated in Sahih al-Bukhari: “When they came to Medina, the prayers were established as you know them, and the two rak’at were kept for the traveler.”

The mosque was not merely the largest in the settlement — it appears to have been the only one in which Jumu’ah was performed, though at least a dozen smaller mosques eventually dotted the scattered communities of Medina, serving those who lived too far to walk to the central mosque five times a day.

And so the foundations were laid — not just of mud brick and palm trunk, but of a community, a polity, a way of life. The mosque rose before the houses. The call to prayer echoed before the treaties were signed. The spiritual infrastructure preceded the political, because the Prophet understood something that every subsequent generation would need to relearn: a civilization built on anything other than its connection to God is a civilization built on sand.

In the weeks ahead, the Prophet would turn his attention to the social architecture of this new community — pairing each Muhajir refugee with an Ansari brother in an unprecedented act of institutional solidarity, and drafting a constitutional treaty that would define the rights and obligations of every group in Medina: Muslim, Jewish, and pagan alike. But all of it would radiate outward from this simple structure of clay and palm — the mosque that was built before anything else, on a plot of land purchased from two orphans, in a city that had just changed its name.