 Saladin consolidated his control in Egypt after ordering Turan @-@ Shah to put down a revolt in Cairo staged by the Fatimid army 's 50 @,@ 000 @-@ strong Nubian regiments . After this success , Saladin began granting his family members high @-@ ranking positions in the country and increased Sunni Muslim influence in Shia Muslim @-@ dominated Cairo by ordering the construction of a college for the Maliki school of jurisprudence of Sunni Islam in the city , and another for the Shafi 'i school , to which he belonged , in al @-@ Fustat . In 1171 , al @-@ <unk> died and Saladin took advantage of this power vacuum , effectively taking control of the country . Upon seizing power , he switched Egypt 's allegiance to the Baghdad @-@ based Abbasid Caliphate which adhered to Sunni Islam . 
