On January 22, 1517, the Ottoman sultan, Selim I, defeated Tuman Bey, the last of the Mamelukes. He made radical changes in the governance of the Jewish community, abolishing the office of nagid, making each community independent, and placing David ibn Abi Zimra, at the head of that of Cairo. He also appointed Abraham de Castro to be master of the mint. It was during the reign of Salim's successor, Suleiman I, that Aḥmad Pasha, Viceroy of Egypt, revenged himself upon the Jews because De Castro had revealed (1524) to the sultan his designs for independence (see Aḥmad Pasha; Abraham de Castro). The "Cairo Purim," in commemoration of their escape, is still celebrated on Adar 28.