 Ayyubid rule virtually ended in 1260 , after the Mongols under Hulagu Khan completely destroyed Gaza — Hulagu 's southernmost point of conquest . Hulagu left his army in Gaza after being recalled due to the death of the Mongol emperor , and Mamluk general az @-@ Zahir Baybars subsequently drove the Mongols out of the city and again defeated them at Baysan in the Galilee . He was proclaimed sultan of Egypt on his way back from the battlefield after the assassination of Sultan Qutuz . Baibars passed through Gaza six times during his expeditions against the remnants of the Crusader states and the Mongols between 1263 and 1269 . Mamluk domination started in 1277 , with Gaza initially being a small village in the territory of Ramla . In 1279 , Sultan al @-@ Mansur Qalawun encamped in Gaza for fifty days while on a march against the Mongols . 
