After Muhammad's death in 632, leadership of the Muslim community passed to caliphs: first the Rashidun (632–661), then the Umayyads ruling from Damascus, and from 750 the Abbasids based in Baghdad, with the line continuing until the Mongol sack of Baghdad in 1258. Through rapid conquest and subsequent governance these caliphates assembled a vast realm stretching from the Iberian Peninsula across North Africa and the Middle East into Central Asia, administered under Islamic law. They fostered a flourishing of trade, scholarship and translation. Rival caliphates, such as the Fatimids and the Umayyads of Córdoba, later emerged.
The caliphates spread Islam, the Arabic language and a shared legal order across three continents, and founded major planned capitals — Baghdad, Córdoba, Cairo, Kairouan — that crystallised the characteristic Islamic city of congregational mosque, palace and covered bazaar.