The building of the Prophet’s mosque

Home > Sira > The First Year of the Prophetic Hijra

The year 1 of the Hijra: the Hijri calendar, the mosque of Qouba, the Islam of Abdallah ibn Salam, the first Friday prayer, the building of the Prophet's mosque, the fever of Medina, the covenant with the Jews and the brotherhood of the emigrants and the Ansar.

Updated on 05 October 2026 at 10:56 AM

Part of: The Year 1 of the Hijra: the Arrival in Medina and the Foundations of the City

The length of the Prophet’s stay in the house of Abou Ayyoub was debated: the Waqidi says seven months, others say less than a month. And Allah is most knowing. The Boukhari reports through Anas ibn Malik: when the Messenger of Allah arrived in Medina, he stopped in the upper part of the city among a clan called the Banu Amr ibn Awf, and stayed with them fourteen nights. Then he sent for the notables of the Banu an-Najjar, who came girded with their swords.

Anas said: I still picture the Messenger of Allah upon his mount with Abou Bakr behind him and the notables of the Banu an-Najjar around him, until he alighted in the courtyard of Abou Ayyoub. He prayed wherever the prayer overtook him, even in the sheep-folds, then ordered the mosque built and sent for the Banu an-Najjar, who came. He said: "O sons of Najjar, sell me this garden." They said: no, by Allah, we seek its price only from Allah.

The garden held graves of the polytheists, ruins and palm trees: the Messenger of Allah ordered the graves of the polytheists dug up, the ruins levelled, and the palm trees cut. The palm branches were set in rows toward the qibla of the mosque, and stones were taken for the pillars. The men carried the stone chanting: "O Allah, there is no good but the good of the Hereafter: so grant victory to the Ansar and the emigrants"; and the Messenger of Allah, among them, said: "O Allah, the reward is indeed the reward of the Hereafter: have mercy on the Ansar and the emigrants."

The Boukhari also reports from az-Zouhri, from Urwa, that the mosque was a mirbad, that is, a date-drying floor, belonging to two orphans under the guardianship of As’ad ibn Zurara, named Sahl and Souhayl: the Messenger of Allah offered them a price, and they said: rather we give it as alms to the Messenger of Allah. He refused until he had bought it from them and built it as a mosque. As he carried the dust with them he said: "This burden, no burden of Khaybar: this is more upright of our Lord and purer." And he said: "O Allah, the reward is indeed the reward of the Hereafter: have mercy on the Ansar and the emigrants." Moussa ibn Oqba reports that As’ad ibn Zurara compensated the two boys with palm trees he owned among the Banu Bayada; it is also said that the Messenger of Allah bought it from them.

Ibn Ishaq says the drying floor belonged to two orphan boys under the guardianship of Mou’adh ibn Afra’: Allah is most knowing. The Bayhaqi reports from al-Hasan al-Basri: when the Messenger of Allah built the mosque, his companions helped him at it, and he carried the clay bricks with them until his chest was covered in dust, and he said: "Build it a shelter like the shelter of Moussa." It was asked: what was the shelter of Moussa? He said: "When he raised his hands, he reached its roof." That route is discontinuous. Ubada ibn as-Samit also reports that the Ansar brought their wealth to the Prophet saying: O Messenger of Allah, build this mosque and adorn it; how long shall we pray under these palm branches? He said: "I have no disinclination toward my brother Moussa: a shelter like the shelter of Moussa." That hadith is strange.

Abou Dawoud reports through Ibn Omar that the walls of the Prophet’s mosque in the lifetime of the Messenger of Allah were of palm trunks, its roof of palm branches; then it collapsed in the caliphate of Abou Bakr, who rebuilt it of trunks and palm branches; then it collapsed in the caliphate of Outhman, who rebuilt it of fired brick: and it stood firm until that day. That account is strange. He also reports, through the route of Nafi’, from Ibn Omar, another version: the mosque in the time of the Prophet was built of unbaked brick, its roof of palm branches and its columns of palm wood; Abou Bakr added nothing; Oumar enlarged it, building upon the Prophet’s construction with unbaked brick and palm branches, and renewed the columns in wood; Outhman changed it, enlarged it greatly, built its walls of dressed stone and teak, made its columns of dressed stone and its roof of sâj. The Boukhari reports this second version through Ali ibn al-Madini, from Ya’qoub ibn Ibrahim.

We say: Outhman ibn Affan interpreted thereby the word of the Prophet: "Whoever builds a mosque for Allah, even like the nest of a quail, Allah will build for him a house in Paradise": the companions present agreed with him and changed nothing after him. From this is inferred the view of the scholars judged prevalent: the enlargement takes the ruling of the first building, so that the ruling of the added part is that of the rest of the mosque, including the lesser reward for prayer in it and the desirability of travel to it. It was enlarged in the time of al-Walid ibn Abd al-Malik, builder of the mosque of Damascus: the enlargement was carried out by his command by Omar ibn Abd al-Aziz, then governor of Medina, who incorporated the prophetic chamber into it; then came many further enlargements, especially on the side of the qibla, until the garden and the minbar came to lie behind the first rows, as is witnessed today.

Ibn Ishaq reports that the Messenger of Allah stayed with Abou Ayyoub until he had built his mosque and his dwellings, and that the Messenger of Allah himself worked at the mosque to encourage the Muslims to work at it: the emigrants and the Ansar worked at it with diligence, and one of the Muslims said: "If we sat idle while the Prophet works, that would be of us a straying deed." The Muslims chanted as they built: "There is no life but the life of the Hereafter: O Allah, have mercy on the Ansar and the emigrants." And the Messenger of Allah said: "There is no life but the life of the Hereafter: O Allah, have mercy on the emigrants and the Ansar." Ammar ibn Yasir came in loaded heavily with bricks and said: O Messenger of Allah, they have killed me: they load me what they do not carry!

Oum Salama reports that she saw the Messenger of Allah brush the dust from his chest with his hand, for he was a curly-haired man, saying: "Woe to ibn Soumayya! It is not they who will kill him, but the rebellious party." This version has a gap, even a difficulty; Mouslim connects it in his Sahih through Chou’ba, from Khalid al-Hadhdha, from Sa’id and al-Hasan, the sons of Abou l-Hasan al-Basri, from their mother Khayra, the freedwoman of Oum Salama, who reported from Oum Salama that the Messenger of Allah said:

"Ammar will be killed by the rebellious party." She also reports, through another route, that he said to him as he carried the stones: "Woe to you, O ibn Soumayya: the rebellious party will kill you." Abd ar-Razzaq reports from al-Hasan, who reports from his mother, from Oum Salama: while the Messenger of Allah and his companions were building the mosque, each of the Prophet’s companions carried one brick, and Ammar carried two, one for himself and one for the Prophet. The Prophet wiped his back and said: "O ibn Soumayya, the people have one reward, and you two: your last provision in this world will be a draught of milk, and the rebellious party will kill you."

That chain meets the condition of the two Sahihs. The Bayhaqi also reports through Khalid al-Hadhdha, from Ikrima, from Abou Sa’id al-Khoudri: we carried one brick each in building the mosque, and Ammar carried two; the Prophet, seeing him, kept brushing the dust off him and saying: "Woe to Ammar! The rebellious party will kill him: he calls them to Paradise and they call him to the Fire." Ammar would say: I seek refuge in Allah from trials.

The Imam al-Boukhari, however, reported this hadith without the words "the rebellious party will kill you".

The Bayhaqi says: it seems he omitted it because of what Mouslim reports, from Abou Nadra, from Abou Sa’id: he who is better than I informed me, namely Abou Qatada, that the Messenger of Allah said to Ammar while he was digging the trench, wiping his head: "Woe to ibn Soumayya: a rebellious party will kill him." The Bayhaqi distinguishes what Abou Sa’id heard himself from what he heard from his companions, and holds that the reference to the trench is an error of the transmitter, or that the Prophet said it to him both in building the mosque and in digging the trench. We say: carrying bricks while digging the trench makes no sense: the apparent conclusion is that the transmitter became confused. And Allah is most knowing.

This hadith is among the proofs of prophethood: the Prophet announced that a rebellious party would kill Ammar, and the people of Syria killed him at the battle of Siffin, Ammar being then with Ali and the people of Iraq. Ali did indeed have more right than Mouawiya, and naming the companions of Mouawiya aggressors does not imply declaring them unbelievers, contrary to what the ignorant of the deviant sect of the Shiites and their like try to claim:

for though they were aggressors in the essence of the matter, they strove as jurists in the fighting they undertook; and not every jurist reaches the truth: the just jurist has two rewards, and the one who errs has one. As for whoever adds after "the rebellious party will kill you" the words "may Allah not grant it my intercession on the Day of Resurrection", he has fabricated against the Messenger of Allah in this addition: for the Prophet never said it, since it was not transmitted by any acceptable route. As for the words "he calls them to Paradise and they call him to the Fire", Ammar and his companions called the people of Syria to concord and unity, while the people of Syria wished to appropriate command at the expense of the one more entitled to it, and to have the people divided under every banner an imam: which leads to the splitting of the word and the division of the community; it follows from their method even if they did not intend it. And Allah is most knowing.

The purpose here is only the story of the building of the Prophet’s mosque, upon its builder the best prayer and salutation. The hafiz al-Bayhaqi reports in the proofs, through Sa’id ibn Jouhan, from Safina, the freedman of the Messenger of Allah: Abou Bakr came with a stone and set it down, then Oumar came with a stone and set it down, then Outhman came with a stone and set it down, and the Messenger of Allah said: "These are the stewards of affairs after me." He reports another version in which the Prophet himself commanded Abou Bakr to set a stone beside his, then Oumar beside that of Abou Bakr, then Outhman beside that of Oumar, then said: "These are the caliphs after me." That hadith, in that form, is very strange.

What is well known is the report of Imam Ahmad, through Sa’id ibn Jouhan, from Safina, that the Messenger of Allah said: "The caliphate after me will last thirty years, then there will be kingship." Safina added: "Retain this: two years the caliphate of Abou Bakr, ten years that of Oumar, twelve years that of Outhman, and six years that of Ali." Abou Dawoud, the Tirmidhi and an-Nasa’i reported it, and the Tirmidhi said: a good hadith which we know only by his route, in the wording: "The caliphate after me thirty years, then biting kingship."

The mosque of the Prophet had, at its founding, no minbar from which the Prophet addressed the people: he would address the people leaning against a palm trunk beside his place of prayer, in the wall of the qibla. When a minbar was made for him, as will be explained in its place, and he turned to it to preach, leaving that trunk, the trunk groaned with a moaning like the moaning of a she-camel whose milk has run dry, because of what it used to hear of the discourses of the Messenger. The Prophet returned to it, embraced it until it quieted, as a newborn is quieted, as will be detailed through the routes of Sahl ibn Sa’d, Jabir, Ibn Omar, Ibn Abbas, Anas and Oum Salama. And how beautiful the words of al-Hasan al-Basri after relating this hadith from Anas ibn Malik: O assembly of Muslims, the wood longed for the Messenger of Allah out of yearning for him; are not the men who hope to meet him more entitled to long for him?

بسم الله الرحمن الرحيم Wed 24 Rabi' al-Thani
الأربعاء 24 ربيع الآخر
هلال متناقص Waning Crescent Day 25.4 / 29.5
Illumination 18%
New moon in 4 days
لا إله إلا الله There is no god but Allah

إِنَّ ٱللَّهَ وَمَلَٰٓئِكَتَهُۥ يُصَلُّونَ عَلَى ٱلنَّبِىِّ ۚ يَٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُوا۟ صَلُّوا۟ عَلَيْهِ وَسَلِّمُوا۟ تَسْلِيمًا

God and His angels shower their blessings on the Prophet. O believers, you should also send your blessings on him, and salute him with a worthy greeting.

Al-Ahzab 33:56

Blessings on the Prophet ﷺ