The history of the mosque begins not with a grand monument but with a simple courtyard house. In the fourteen centuries since, the mosque has travelled across continents and empires, taking countless forms while keeping one unchanging purpose. This guide traces that journey in brief, expanding on our overview of What is a mosque?.
The Prophet’s mosque in Medina (622 CE)
When the Prophet Muhammad, peace be upon him, migrated to Medina in 622 CE, he built beside his home a walled courtyard of mud brick shaded by palm trunks. This was the first true mosque. It set the essential template still followed today: an enclosed courtyard, a covered prayer area, a wall oriented toward Mecca, and a raised place from which to address the community. Crucially, it was also the centre of the new society, a place of prayer, teaching, welfare and governance all at once, a role we explore in role of the mosque in Islam.
The Great Mosque of Damascus and the Umayyads
Within a century, Islam had spread across a vast empire, and mosques grew from humble courtyards into monuments of state. The supreme early example is the Great Mosque of Damascus, built by the Umayyad caliph al-Walid around 706–715 CE on a site that had held a Roman temple and then a church. Faced with marble and shimmering gold mosaics, its three-aisled prayer hall and vast courtyard announced Islam as a world power and became a model admired for generations.
Spread across the empires
From these roots, mosque-building followed the expansion of Muslim rule and trade. The Abbasids raised the enormous mosque of Samarra with its spiral minaret; the Umayyads of Spain built the Great Mosque of Córdoba; the Fatimids founded al-Azhar in Cairo, which became one of the world’s oldest universities. Later the Persians, Ottomans and Mughals each developed their own magnificent styles, while builders in West Africa, China and Southeast Asia adapted the mosque to local materials and taste. We survey these traditions in Mosque architecture styles around the world.
The three holiest mosques
Three mosques hold special significance across all of Muslim history: the Sacred Mosque (al-Masjid al-Haram) in Mecca, which surrounds the Kaaba; the Prophet’s Mosque in Medina; and al-Aqsa in Jerusalem. Each has been rebuilt and enlarged many times over the centuries. You can read more in our guide to Two Holy Mosques.
The mosque today
Mosques never stopped evolving. In the modern era they have followed Muslim communities into Europe, the Americas and beyond, sometimes as purpose-built landmarks, sometimes as converted houses, churches or shops. From a courtyard in Medina to a glass-and-steel building in a Western city, the through-line is unbroken: a clean space, oriented to Mecca, where a community gathers to pray. Explore that living history near you and find mosques with MosqueFinder.