 The Mamluks forged an alliance with the Crusaders in March 1252 and agreed to jointly launch a campaign against an @-@ Nasir Yusuf . King Louis , who had been released after al @-@ Mu 'azzam Turan @-@ Shah 's murder , led his army to Jaffa , while Aybak intended to send his forces to Gaza . Upon hearing of the alliance , an @-@ Nasir Yusuf immediately dispatched a force to Tell al @-@ Ajjul , just outside Gaza , in order to prevent the junction of the Mamluk and Crusader armies . Meanwhile , the rest of the Ayyubid army was stationed in the Jordan Valley . Realizing that a war between them would greatly benefit the Crusaders , Aybak and an @-@ Nasir Yusuf accepted Abbasid mediation via Najm ad @-@ Din al @-@ <unk> . In April 1253 , a treaty was signed whereby the Mamluks would retain control over all of Egypt and Palestine up to , but not including , Nablus , while an @-@ Nasir Yusuf would be confirmed as the ruler of Muslim Syria . Thus , Ayyubid rule was officially ended in Egypt . After conflict arose between the Mamluks and the Ayyubids reignited , al @-@ <unk> arranged another treaty , this time giving an @-@ Nasir Yusuf control of the Mamluks ' territories in Palestine and al @-@ Arish in Sinai . Instead of placing Ayyubids in charge , however , an @-@ Nasir Yusuf handed Jerusalem to a Mamluk named <unk> while Nablus and Jenin were given to Baibars . 
