The history of Masjid Nabawi (the Prophet's Mosque), in Medina, spans over fourteen centuries, tracing a continuous narrative of spiritual centralization, geopolitical shifts, and cultural synthesis that mirrors the trajectory of Islamic civilization itself. Initially built in 622 CE (1 Hijri) as an all-encompassing institution but as a modest communal structure, the historical trajectory of the site is characterized by its transition from the socio-political capital of the early Caliphate to a monumental locus of dynastic legitimacy during the middle ages and global pan-Islamic pilgrimage in to the modern period.
While the physical boundaries of the mosque expanded across successive imperial eras, its historical legacy remains anchored in its role as the premier theater of early Islamic governance, theological discourse, and institutional evolution. Crucially, the history of Masjid al-Nabawi must not be conflated with its mere physical construction phases. While its structural chronology tracks the material evolution of stone, mortar, and spatial expansions, its true historical narrative is defined by a profound institutional transition. If we could apply modern terminology, the mosque evolved from a universal social, economic, political, and legal hub of early Islamic society into a specialized, universally venerated sacred religious complex and global pilgrimage destination.
The historical documentation of the Prophet's Mosque relies on a robust tradition of classical Islamic historiography, urban chronicles, and travel literature (Rihla). Early developments and territorial disputes are preserved in the 8th- and 9th-century works of historians such as Ibn Ishaq and al-Waqidi. Detailed architectural and social histories of the mosque emerged premarily during the medieval period, most notably in Ibn Zabala's now lost 9th-century CE chronicle of Medina which is only largely preserved in later texts. al-Samhudi's definitive 15th-century CE work, Wafa al-Wafa bi Akhbar Dar al-Mustafa also provide distinct and descriptions of how the mosque and its role eveolved over the centuries. These narrative texts, supplemented by epigraphic evidence and the eyewitness accounts of medieval travelers like Ibn Jubayr and Ibn Battuta, provide a granular record of how the mosque functioned as a living institution through centuries of political developments, fires, and reconstructions.
circa 622–632 CE
The Prophetic Era
Following the Hijrah in 622 CE (circa 1 Hijri), the establishment of a meager stone-mud-brick structure served as the primary location for the social and urban fabric of ancient Yathrib, which was subsequently renamed al-Madinah al-Munawwarah.
According to tradition the she-camel, named al-Qaswa, of Prophet Muhammad on the command of Allah demarcated the location of the mosque, on the same day prophet arrived in Medina from Mecca in 621/622 CE. The selected site was a mirbad, a commercial plot used for drying dates, belonging to two Banu Najjar orphans, Sahl and Suhayl, under the guardianship of As'ad ibn Zurarah. In one tradition, the Prophet Muhammad is said to have himself purchased the land directly; in another, the funds were provided by Abu Bakr al-Siddiq on prophet's behalf to legitimize the land's public title. Structurally, the initial almost square enclosure measured approximately 70 by 60 cubits. The outer walls were constructed with unbaked mud bricks (labin) resting on stone foundations. The enclosure was partially roofed on the north with palm fronds (jarid) supported by palm-trunk columns (juda').
The first adhan was pronounced from a private house adjacent to the Masjid Nabawi, however, later on a small circular elevated platform. This may have been a precursor to the minaret.
In Rajab 2 Hijri (January 624 CE), the congregation at Masjid al-Nabawi underwent a physical reorientation of qibla direction. Prior to this date, the mosque had been built with its prayer direction (qibla) oriented northward toward Bayt al-Maqdis (Jerusalem), a direction the Prophet and his companions had observed since before the Hijrah. Following the Quranic revelation of verse 2:144 — which commanded the reorientation of prayer toward the Masjid al-Haram in Mecca, the congregation at Masjid al-Nabawi turned southward mid-prayer. A hadith in Sahih al-Bukhari records that revelation was received at the Masjid Qiblatain but the Prophet's first Asr prayer facing the Ka'bah was performed at Masjid al-Nabawi following this revelation. The physical fabric of the mosque was subsequently restructured: the original northern prayer wall became the rear wall of the enclosure, a new southern wall was constructed to anchor the direction toward Mecca, and the roofed portion of the mosque was extended to support three rows of palm-trunk columns. This event is unique in the mosque's architectural history as the only instance in which a divine liturgical command produced an immediate, irreversible physical reorganization of the building's orientation during its foundational era.
The stark paradox of this foundational but meager structure lies in the extreme disproportion between its physical humility and the concentrated complexity, diversity and significance of its institutional operations. It operated as a legislative assembly where constitutional decrees, such as the Mithaq al-Madinah (Constitution of Medina: see note 1), were enacted, and as a supreme judicial court where the Prophet adjudicated inter-tribal and civil disputes. Military logistics and strategic deployments, including the mobilizations for the Battles of Badr and Uhud, were planned within the courtyard, which also housed a defensive armory. In modern terms, the Prophet's Mosque functioned much like a "town hall", but one that simultaneously housed every branch of governance the nascent Islamic state needed. Despite having a physical footprint that would represent a fraction of a modern religious complex, the mudbrick enclosure functioned simultaneously as legislature, judiciary, military command center, diplomatic reception hall, residential academy as well as a charity institution (see note 2).
The mosque's role as the primary diplomatic reception space of the nascent Islamic state is documented across multiple attested encounters, most densely in the period following the conquest of Mecca in 8 Hijri, when tribal delegations from across the Arabian Peninsula arrived to negotiate terms of allegiance. The year 9 Hijri became known in the Islamic historical tradition as the 'Am al-Wufud (the Year of Delegations) and the mosque served as the primary site for their reception. The Prophet would receive these groups leaning against a palm trunk at what later became known as the Ustuwanah al-Wufud (Pillar of Delegations), a structural memory sufficiently significant that the pillar retained its designation across subsequent centuries of expansion. Among these encounters, the Banu Tamim chieftains arrived and requested a contest of tribal oratory and poetry within the mosque, an established form of Arab precedence-claiming that the Prophet engaged directly by appointing Thabit ibn Qays ibn Shammas as his respondent, with the encounter recorded in both Ibn Ishaq's Sira and Sahih al-Bukhari. The Banu Thaqif of Ta'if, also in 9 Hijri, were accommodated within a tent pitched inside a corner of the mosque for the duration of their negotiations, allowing them to observe Muslim prayer as a deliberate component of their reception, another well attested instance of the mosque being physically adapted to serve a processual diplomatic function. In 10 Hijri, al-Ash'ath ibn Qays arrived with a delegation of eighty Kinda riders from southern Arabia; Ibn Ishaq records explicitly that "they went in to the apostle in the mosque", their formal submission within the congregational space concluding the principal phase of peninsular consolidation.
The mosque also served as the site of the most formally documented inter-religious encounters of the Prophetic era, occasions on which its spatial boundaries were extended to accommodate non-Muslim visitors in ways that later jurisprudential tradition would engage with extensively. In 9 Hijri, Adi ibn Hatim al-Ta'i, chief of the Tayy tribe and son of the poet Hatim al-Ta'i, entered the mosque wearing a gold cross, was received by the Prophet, and engaged in a theological exchange recorded in Ibn Kathir's Tafsir via chains traced to Ahmad ibn Hanbal and al-Tirmidhi; his conversion within the mosque drew the Tayy tribe as a whole into the Islamic polity. Another of these well known encounters was the arrival of the Christian delegation from Najran in 10 Hijri — bishops and scholars who came to engage the Prophet in theological disputation concerning the status of Jesus, recorded in Ibn Ishaq's Sira and referenced in Surah al Imran (3:61). When the time for the delegation's prayer arrived, the Prophet permitted them to perform it within the mosque facing east according to their own rite. The encounter concluded not with the proposed Mubahala — a mutual invocation of divine curse to settle the dispute — but with the Treaty of Najran, making the mosque the site of both inter-religious theological disputation and formal treaty negotiation between the Islamic state and a non-Muslim community.
The northern section of the mosque accommodated the Suffah, a dedicated raised platform that institutionalized Islam's first residential academy for disenfranchised companions who had no family, home, or income in Medina. Under the instruction of teachers such as Ubai ibn Ka'b, the ahl al-Suffah were housed, fed, and educated within the mosque's physical fabric on a permanent basis. Their sustenance was drawn from alms brought directly to the Prophet within the Masjid Nabawi's congregational space, which he redistributed among them; wealthier companions would additionally send food and provisions directly to the platform. The Suffah thus embedded a formal welfare institution within the mosque's spatial economy — one in which the congregational floor served simultaneously as a site of worship, charitable distribution, and residential shelter for the community's most vulnerable members.
Architecturally integrated into the eastern perimeter were the Hujurat (domestic quarters), constructed with wattle-and-daub walls and mud-brick for the Prophet's wives, Aisha bint Abi Bakr and Sawda bint Zam'a. The direct, unmediated physical access from these private chambers into the public congregational space dissolved any structural boundary between the domestic household and the administrative governance of the early Ummah, a spatial intimacy that would later acquire profound theological and political significance when the chamber of Aisha became the site of the Prophet's burial.
circa 632–661 CE
Rashidun Caliphate
Following the death of the Prophet in 632 CE (circa 11 Hijri), the mosque transitioned from an unmediated charismatic headquarters into the primary institutional space where the succession and early executive authority of the Rashidun Caliphate were contested and solidified. It served as the central assembly for the Bay'ah (oaths of allegiance) tendered to Abu Bakr al-Siddiq and subsequently to Umar ibn al-Khattab. During this era, the site functioned as the supreme command post managing the logistics of the Riddah Wars (Apostasy Wars) and the administrative oversight of the early Islamic expansions into the Levant and Persia. The first major physical expansion of the mosque was initiated by Umar ibn al-Khattab in 638–639 CE (17 Hijri), extending the structure northward, southward, and westward to accommodate the rapidly evolving role of the mosque and growing Muslim population of Medina .
A critical shift in the sacred topography of the complex occurred during this period: the Hujrah of Aisha bint Abi Bakr was permanently converted from a residential domestic space into a mausoleum following the burials of the Prophet, Abu Bakr, and Umar within its walls. This conversion may have sowed the seeds of institutionalization of what had been a private chamber as a permanent locus of dynastic and spiritual gravity; a transformation that every subsequent ruling dynasty would be compelled to negotiate, monumentalize, or contest.
By the Caliphate of Uthman ibn Affan, the administration of the rapidly expanding empire had exposed the structural limits of the mosque's original rudimentary layout, prompting a significant overhaul. Uthman replaced the original palm-trunk pillars with dressed stone columns bound with mortar and reinforced with iron dowels, and constructed a roof of fine teakwood (saj). This material upgrading reflected not merely practical necessity but the changing self-conception of an empire that now administered territories stretching from North Africa to the Iranian plateau.
The era concluded in severe political fracture. The civil strife of the First Fitna directly penetrated the sanctuary: escalating grievances against Uthman's administration culminated in a prolonged siege of his nearby residence, which directly disrupted the congregational life of the mosque. Following his assassination in 656 CE and the subsequent relocation of the political capital to Kufa by Ali ibn Abi Talib, the mosque relinquished its status as the executive center of the empire. It retained, however, the contested symbolic authority of the site where the Prophet had governed — a distinction between functional power and sacred legitimacy that would define the mosque's identity through every subsequent dynasty.
circa 661–750 CE
Umayyad Era
The relocation of the political capital to Damascus presented the Umayyad Caliphate with a structural challenge: how to project authority over the city of Medina now geographically distant from the center of power. The moment the caliphs departed Medina, the mosque ceased to function as an "imperial parliament" or military command center in any operational sense. Its institutional reinvention under the Umayyads was therefore deliberate: by transforming it from a vernacular civic structure into a monument of dynastic magnificence, the Umayyads converted what they could no longer use into something they could instead venerate, and control through the symbolic authority that veneration confers.
The decisive intervention occurred during the reign of al-Walid I (reigned 705–715 CE), who assigned the governorship of Medina to Umar ibn Abd al-Aziz and charged him with a comprehensive reconstruction. The Umayyads demolished the remaining original Hujurat, a move that provoked significant socio-religious protest among Medinan traditionalists who regarded the domestic ruins as sacred relics, and in their place commissioned an elaborate decorative program. The artisans responsible for this program included Coptic, Greek, and Levantine craftsmen; al-Walid is recorded as having supplied both mosaics and workers for the project, with raw materials procured partly from Byzantine imperial sources. Medieval sources occasionally attributed the workforce specifically to a gift of artisans from the Byzantine emperor, though modern scholarship regards most of the craftsmen as having been drawn from Syria, Palestine, and Egypt, regions where mosaic traditions had been continuously maintained since late antiquity. The resulting interior was lined with gold-ground glass mosaics (fushayfisha) depicting paradisiacal flora, explicitly mirroring the visual language of the contemporaneous Umayyad Mosque in Damascus.
The same reconstruction program introduced enduring liturgical and structural elements: four corner minarets (manarah) formalized the call to prayer as a publicly projected, architecturally anchored ritual; and a deeply recessed mihrab (prayer niche) permanently crystallized the orientation of the Qiblah within the built fabric of the structure. These additions, the minaret broadcasting Islamic practice into urban space, the mihrab fixing devotional direction in stone; were not merely decorative decisions. They were institutional ones, converting the mosque's function from a flexible civic hall into a specialized apparatus of Islamic worship.
circa 750–1256 CE
Abbasid Period
With the rise of the Abbasid Caliphate and the further displacement of the imperial center to Baghdad, patronage of Masjid al-Nabawi assumed a defensive ideological character. The Abbasids used infrastructural investment in the mosque to counter persistent Alid (proto-Shi'ite) political claims to Medina and to assert Sunni legitimacy over the sanctuary of the Prophet. Caliph al-Mahdi (reigned 775–785 CE) initiated a major northern expansion, standardizing the structural bay system and enriching the interior with elaborate marble paneling and gold inscriptions that emphasized Abbasid dynastic authority.
This era also witnessed the progressive externalization of the mosque's non-religious civic functions. As the Islamic state developed a complex and formalized administrative apparatus, the institutions that had once been housed within the Prophet's Mosque were systematically relocated to purpose-built structures outside it. Rulers and local emirs constructed dedicated madrasas (schools) and bimaristans (hospitals) in the precincts of Medina, while charitable feeding of the poor, a function previously embedded within the congregational economy of the mosque itself, was increasingly institutionalized in dedicated dar al-diyafa (houses of hospitality) funded through waqf endowments. The mosque did not lose its importance during this process; rather, its importance was progressively redefined as exclusively religious, as the social and civic functions it had once monopolized migrated to institutions built specifically to house them.
As the central power of Baghdad fractured in the 10th and 11th centuries CE, the mosque became a dedicated space for proxy geopolitical competition. Local Alid emirs, the Emirs of Medina, controlled the mosque-complex and fluctuated their formal allegiances between the Sunni Abbasids in Baghdad and the Ismaili Fatimid Caliphate in Cairo. The Friday sermon (khutbah), whose nominal dedication to a ruling sovereign was the primary liturgical expression of political legitimacy, shifted its invocation depending on which empire wielded financial or military leverage over the Hejaz at any given moment. By the 12th century CE, when travelers from North Africa and Andalusia began arriving in greater numbers, the mosque had completed its transition into an international pilgrimage hub; a shift vividly recorded in their travelogues (Rihla) and one that would only accelerate under Mamluk administration.
circa 1250s CE
Pre-Mamluk Transition
The classical era of the Masjid Nabawi concluded not through political decree but through environmental catastrophe. On 1 Ramadan 654 Hijri (circa 1256 CE), a fire broke out within the mosque and spread catastrophically through the interior. al-Samhudi and contemporary chroniclers record that the fire originated in the eastern section of the sanctuary; other accounts attribute the ignition to a candle or oil lamp whose flame caught the curtains, carpets, and prayer mats before consuming the roof entirely, cracking the marble columns, and melting the silver ornamentations of the prophetic enclosure. Both accounts agree on the scale of destruction: the mosque was rendered structurally devastated. The minbar, which had stood since the Prophetic era, was destroyed in this fire; a replacement was subsequently dispatched by the ruler of Yemen, al-Malik al-Muzaffar Shamsuddin, in 656 Hijri (1258 CE).
This disaster occurred precisely as Mongol forces under Hulagu Khan were advancing on Baghdad, leaving the Abbasid state incapable of orchestrating a comprehensive response. Fragmented stabilization efforts fell to the final Abbasid Caliph, al-Musta'sim, and the regional Ayyubid rulers of Yemen and Syria, the latter dispatching workers and construction materials to begin restoring the roof over the Riyad al-Jannah and the sacred chambers. The incompleteness of this response, combined with the Mongol sack of Baghdad in 1258 CE that extinguished the Abbasid Caliphate entirely, created the power vacuum into which the Cairo-based Mamluk Sultanate stepped to claim permanent custodianship of the Haram.
circa 1258–1517 CE
Mamluk Era
Following the sack of Baghdad, the Mamluk Sultanate asserted its position as the preeminent defender of Sunni Islam by seizing administrative and financial control over the Hejaz reigion. The Mamluks estanlished the office of the Shaykh al-Haram (Superintendent of the Sanctuary), appointing elite court eunuchs to manage the internal security, liturgical order, and asset distribution of Masjid al-Nabawi. This administrative structure served a precise political function: it converted the mosque into the primary vehicle through which non-Arab, formerly enslaved military rulers could project legitimacy on the global Islamic stage. Custodianship of the Prophet's Mosque, expressed through the formal bureaucratic apparatus of the Shaykh al-Haram, was the Mamluk answer to the question of how rulers without Arab lineage or caliphal bloodline could claim Islamic authority.
The Mamluks increasingly formalized the logistics of the Ziyarah (visitation). The mosque was managed through massive waqf (pious endowment) networks specifically structured to receive and provision international caravans arriving for worship. This institutional apparatus was reflected in the social life of the sanctuary as recorded by Ibn Battuta, who visited in 1326 CE. He documents large nocturnal halqat (circles) in the courtyard, where pilgrims and local residents gathered around arrays of candles to recite the Quran from specialized book-rests and intonate panegyrics dedicated to the Prophet. He further records a thriving economy of institutional charity, noting how wealthy travelers used the congregational floor to distribute alms directly to the mujawwirun, the poor who lived semi-permanently within the sanctuary's perimeter. The mosque had become, in Ibn Battuta's account, a self-sustaining devotional economy operating at an international scale.
Architecturally, the Mamluks prioritized the containment and monumentalization of the prophetic burial chamber. Sultan Baybars I constructed a high wooden enclosure around the tomb in the 1260s CE, and in 1279 CE (678 Hijri), Sultan al-Mansur Qalawun erected the first formal dome over the Hujrah of Aisha, a wooden structure, initially unpainted, marking the first time the prophetic tomb was distinguished by a dedicated visual marker above the roofline. This was a decisive architectural act: it converted the burial site from a chamber integrated within the mosque's fabric into a visually autonomous monument, visible and legible from outside the structure itself.
The second catastrophic fire struck on a night in Ramadan 886 Hijri (1481 CE), when a lightning bolt ignited the main minaret. The fire spread rapidly, destroying the vast majority of the mosque's interior, collapsing the roof, killing the muaddhin, and threatening adjacent residential structures in Medina before it was contained by the city's inhabitants. al-Samhudi, who was present in Medina during this period and compiled his Wafa al-Wafa in its aftermath, provides the most detailed contemporary account of both the destruction and the reconstruction that followed. The response was orchestrated by Sultan Qaitbay, who dispatched 400 artisans and 372 load animals along with materials transported by both land and sea routes. Qaitbay replaced the compromised wooden roof structures with fireproof stone vaults, rebuilt the southeastern minaret in the distinct multi-tiered Mamluk style, and reconstructed the dome over the prophetic tomb using dressed brick covered in lead. He also added a madrasa, a ribat (rest house for travelers), bathing facilities, a kitchen, a mill, and a library to the complex; a telling illustration of how the Mamluk state conceived of the mosque not merely as a prayer hall but as a self-sufficient institution for the long-term accommodation of international pilgrims. This structural overhaul permanently defined the core layout of the southern prayer hall that subsequent Ottoman builders would inherit.
circa
Ottoman Period
With the Ottoman conquest of Egypt in 1517 CE, Selim I assumed the title of Khadim al-Haramayn al-Sharifayn (Servant of the Two Holy Sanctuaries), transferring administrative oversight of Medina from Cairo to Istanbul. The Ottomans integrated the mosque into a vast imperial waqf network, channeling tax revenues from Egypt and Syria directly toward the maintenance of the sanctuary and the provisioning of its resident scholars (Ulema). In 1589–90 CE (998 Hijri), Sultan Murad III dispatched an elaborately ornamented marble minbar, manufactured in Istanbul, to replace the existing pulpit; an act that physically inscribed Ottoman imperial craftsmanship into the devotional heart of the mosque (Riyadhul Jannah). This minbar remains in the mosque to the present day.
The physical profile of the mosque underwent its most iconic transformation under Sultan Mahmud II. In 1818 CE, following the Ottoman recovery of Medina from the first Saudi-Wahhabi state, Mahmud II commissioned a complete rebuilding of Qaitbay's deteriorating lead-covered brick dome using dressed stone masonry. In 1837 CE, he ordered this rebuilt dome to be painted green — a visual decision of enduring consequence, producing the globally recognized Qubbat al-Khadra (Green Dome) that remains the defining visual symbol of the mosque-complex worldwide.
The definitive architectural intervention of the Ottoman era was the grand expansion initiated by Sultan Abd al-Majid I, spanning from 1848 to 1860 CE. Rejecting mere restoration, Abd al-Majid demolished the northern sections of the mosque and rebuilt them with red sandstone quarried from nearby Wadi al-Aqiq. Imperial master calligraphers, led by Abdullah Zuhdi, spent years hand-carving Thuluth script across the entire northern wall and the interiors of the domes, recording Quranic verses and the honorific titles of the Prophet. This mid-19th-century CE intervention transformed the mosque into a masterpiece of classical Ottoman visual culture while retaining the foundational southern layout inherited from the Mamluk reconstruction.
The institutional trajectory of this era, however, was shaped less by these architectural events than by the Tanzimat reforms of 1839–1876 CE, which systematically extracted secular judicial and municipal operations from the congregational space of the mosque and reallocated them to newly established imperial councils (Meclis) and specialized municipal bureaus in Medina. Civil lawsuits, commercial contracts, and local governance — functions that had once been conducted within or immediately adjacent to the mosque; were legally reassigned to purpose-built state institutions. This administrative reorganization accelerated a process of institutional specialization that had been developing since the Abbasid period, and for the first time formalized it through explicit legislative decree rather than gradual organic change. The construction of the Hejaz Railway in 1908 CE, linking the historic city of Damascus directly to a Medina terminus, completed this transformation in logistical terms: by routing global pilgrims rapidly and directly to the threshold of the sanctuary, while simultaneously outsourcing all civil administration to external state buildings, the late Ottoman era established the institutional and infrastructural blueprint that the Saudi state would inherit and extend.
circa
Modern/Saudi Period
The collapse of the Ottoman Empire and the unification of the Kingdom of Saudi Arabia dissolved the multi-dynastic imperial system of patronage that had governed the mosque for over a millennium, replacing it with a centralized bureaucratic nation-state administration. Management of the sanctuary was transferred to a specialized government ministry, and the mosque was reconceived as a heavily engineered, state-managed global apparatus for the reception of pilgrims.
During the Saudi era, the final residual remnants of local civic utility were systematically extracted from the space and institutionalized elsewhere. Legal contracts, judicial proceedings, and municipal affairs were formally prohibited within the prayer halls and legally transferred to state ministries, civil courts, and government offices. This was not a gradual cultural shift but an administrative act; the formal legal completion of a process of institutional specialization that had begun with the Abbasid construction of external madrasas and bimaristans a millennium earlier.
The modern expansions removed adjacent historic residential and commercial districts to create vast open plazas, stripping the sanctuary of its remaining domesticity and transforming it into a hyper-engineered infrastructure exclusively dedicated to the management of global pilgrim flows. For over a millennium, access to the historical core had been conditioned by regional camel caravans and seasonal maritime travel, limiting seasonal visitor volumes to tens of thousands. The convergence of modern aviation, retractable Teflon umbrella canopies, multi-level prayer decks, and automated crowd-control technologies shifted the human experience of the space into a register without historical precedent.
However, during this period civic functions such as medical, transportaion, religious and education were introduced; these remain as support facilities; rather than fully civic and centralized institutions.
The historical structures of the Ottoman and Mamluk eras were physically absorbed into this modern apparatus, retained within the expanded complex but now surrounded and dwarfed by the engineering infrastructure of mass pilgrimage. Today, the historical site operates as a living tension between ancient material fabric and hyper-modern crowd logistics, serving as an international crossroads for millions of global Muslims annually and remaining the premier symbol of historical continuity within Islamic civilization.
Signup for our monthly newsletter / online magazine.
No spam, we promise.