 In the early 1380s , the governor of Gaza , Akbuga Safawi , plotted to commit treason against Sultan az @-@ Zahir Barquq . The plot was detected and Safawi was exiled to al @-@ Karak , and replaced by Husam al @-@ Din ibn Bakish . Soon after , the city fell into the hands of Emir Yalbugha an @-@ Nasiri who revolted against Barquq . Gaza was retaken without violence , and Ibn Bakish met Yalbugha at its gates with gifts and proposals of peace . The unseated Barquq regained his throne in 1389 , and retook Gaza the next year . In 1401 a swarm of locusts destroyed Gaza 's crops . A battle between the rival Mamluk emirs Akbirdi and Qansuwa Khamsiyah occurred in Gaza ; Khamsiyah had failed in usurping the Mamluk throne and fled to Gaza where he made his unsuccessful last stand . Between 1428 and 1433 , Gaza was governed by Emir Sayf ad @-@ Din Inal , who would later become sultan in 1453 . During his sultanate , in 1455 , Inal 's dawadar ( executive secretary ) had the Madrasa of Birdibak built in the Shuja 'iyya neighborhood . 
