In 1031 the leading families in Spain abolished the Umayyad caliphate and the period of “petty kings” began who ruled small divisions of Spain. In 1085 Toledo was captured by Alfonso VI thus the other petty kings invited the ruler of the Almoravids in Morocco, Yusuf ibn Tashfin, to fight Alfonso in 1086, beginning the Almoravid rule in Islamic Spain. In 1071 the Rum Seljuk defeated the Byzantines in eastern Anatolia and Armenia. In early 13th century the Mongols arrived in Transoxiana and in 1218 conquered Khurasan, Khwarzim, Iran the Caucasus Mountains. In 1243 they defeated the Seljuks in the battle of Kosedab and reduced them to protectorates of the Mongols. The Mongols invaded Iran followed by Baghdad and executed the last Abbasid caliph ending the caliphate.
The end of the caliphate signalled a new era of political rule by the Mongols. The Islamic community had spread throughout the world and it was not bounded by political boundaries anymore, rather it was defined by religious and cultural beliefs which aided its survival under non-Islamic rulers such as the Mongols.