 Although the mosque @-@ school was the leading university in the Islamic world and had regained royal patronage , it did not overtake the madrasas as the favored place of education among Cairo 's elite . Al @-@ Azhar maintained its reputation as an independent place of learning , whereas the madrasas that had first been constructed during Saladin 's rule were fully integrated into the state educational system . Al @-@ Azhar did continue to attract students from other areas in Egypt and the Middle East , far surpassing the numbers attending the madrasas . Al @-@ Azhar 's student body was organized in riwaqs ( fraternities ) along national lines , and the branches of Islamic law were studied . The average degree required six years of study . 
