The Safavid dynasty (1501–1736) returned Iran to the ranks of the great powers and permanently fixed Shi'ism as its national identity. It sprang from the Sufi order of Ardabil (founded by Sheikh Safi in the thirteenth century), whose masters claimed descent from the seventh imam; in 1501 Ismail I, aged fourteen, took Tabriz and proclaimed himself shah, immediately making Twelver Shi'ism the state religion — imposed by force in a Sunni sea: jurists were imported (from Jabal Amil in Lebanon), edicts cursed the first three caliphs, and grassroots conversion followed, so that within generations Iran was Shi'ite. The Qizilbash tribal cavalry and the ghulam slave-bureaucratic military system created by Abbas I formed the twin pillars of the state; Abbas moved the capital to Isfahan, "Isfahan is half the world" being its glory. The Afghan invasion of 1722 overthrew the dynasty (Nader Shah picked up the pieces), yet the Shi'ite state religion had become irreversible: thereafter the sectarian divide between Iran and the Ottoman (Sunni) and Mughal (Sunni) worlds (Sunni–Shia) became a constant of Middle Eastern political geography, down to today's confrontation between Iran and the Gulf states.