quality:corruption
Revival of military strength (1118–1258)

While the caliph al-Mustarshid was the first caliph to build an army capable of meeting a Seljuk army in battle, he was nonetheless defeated and assassinated in 1135. The caliph al-Muqtafi was the first Abbasid Caliph to regain the full military independence of the caliphate, with the help of his vizier Ibn Hubayra. After nearly 250 years of subjection to foreign dynasties, he successfully defended Baghdad against the Seljuqs in the siege of Baghdad (1157), thus securing Iraq for the Abbasids. The reign of al-Nasir (d. 1225) brought the caliphate back into power throughout Iraq, based in large part on the Sufi futuwwa organizations that the caliph headed. Al-Mustansir built the Mustansiriya School, in an attempt to eclipse the Seljuq-era Nizamiyya built by Nizam al Mulk.