 Despite their defeat by Selim I and the Ottomans in 1517 , the Mamluks remained influential in Egyptian society , becoming beys ( " chieftains " ) , nominally under the control of the Ottoman governors , instead of amirs at the head of an empire . The first governor of Egypt under Selim I was Khai 'r Bey , a Mamluk amir who had defected to the Ottomans during the Battle of Marj Dabiq . Though the Mamluks launched multiple revolts to reinstate their Sultanate , including two in 1523 , the Ottomans refrained from completely destroying the Mamluk hold over the power structure of Egypt . The Mamluks did suffer losses — both economic and military — in the immediate aftermath of the Ottoman victory , and this was reflected in the lack of financial assistance provided to al @-@ Azhar in the first hundred years of Ottoman rule . By the 18th century the Mamluk elite had regained much of its influence and began to sponsor numerous renovations throughout Cairo and at al @-@ Azhar specifically . 
