The Quraysh ruled the cities of Mecca and Medina, and expelled their member Muhammad from the former to the latter in 622, from where he began spreading his new religion, Islam. In 631 Muhammad marched with 10,000 to Mecca and conquered it before dying the next year. His successors united most of Arabia in the Ridda wars (632-633) and then started the Muslim conquests of the Levant (634-641), Egypt (639-642) and Persia (633-651), the latter ending the Sasanian empire. In less than a decade after his death, the Islamic Rashidun Caliphate extended its reach from Atlas Mountains in the west to the Hindu Kush in the east. However, the First Fitna led to its replacement by the Umayyad Caliphate in 661, moving the centre of power to Damascus. At its height, the Umayaads ruled a third of the world's population. In 750, the Abbasid Caliphate replaced the Umayyads in the Abbasid Revolution. In 762, they moved the capital to Baghdad. The Emirate of Córdoba remained under Umayaad rule, while in 788 the Idrisid dynasty broke away in Morocco. The Fatimid Caliphate started taking over North Africa from 909 onwards, and the Buyid dynasty broke away in Persia and later Mesopotamia starting in the 930's.In 711, the Umayyad conquest of Hispania began, and in 717 they crossed the Pyrenees into the European Plain. They were met by the Merovingian dynasty, which had been established by Clovis I (481-511), which was in decline, leading Charles Martel to seize power and defeat the invasion force at the Battle of Tours in 732. His son Pepin the Short established the Carolingian dynasty in 751. Charlemagne (768-814) turned it into the Carolingian Empire, being crowned Emperor of the Romans in 800 by the Pope, with this forming the basis for the later Holy Roman Empire. Meanwhile, in Eastern Europe, Krum (795-814) expanded the Bulgarian Empire. The Treaty of Verdun divided Carolingian Empire into West, Middle and East Francia.