Mount to the order. Grand master Armand de Périgord triumphantly reported the return of the Templars to their original home to the pope. While the treaty promised to enhance Frankish security in Syria, but would prove toothless in light of the impending onslaught. The Ayyubids and the loss of Jerusalem Since the death of the sultan al-Kamil in 1238, the political situation in Egypt and the Levant was chaotic, stoked by rivalries between his sons. In early 1240, while making ready to invade Egypt, as-Salih Ayyub, the eldest son, was informed that his half-brother Al-Adil II, then sultan, was being held prisoner by his own soldiers. He was invited to come at once and assume the sultanate. In June 1240, he made a triumphal entry into Cairo and assumed rule of the dynasty. Once installed in Cairo, as-Salih was far from secure, as the dynasty and associated Kurdish clans had divided loyalties. Within Egypt, a powerful faction of emirs were conspiring to depose him and replace him with his uncle, as-Salih Ismail, who had regained control of Damascus. As-Salih took refuge in the Cairo citadel, no longer trusting even the once-loyal emirs who had brought him to power. Kipchak slaves became available following the Mongol invasions in central Asia and soon formed the core of his army known as Mamluks. Before the end of the Seventh Crusade, the Mamluks would eventually overthrow the Ayyubid dynasty and take power on their own. Beginning in 1240, a Central Asian tribe known as the Khwarezmians attacked the territories of Aleppo and would within four years decimate the Levant. Lacking strong leadership since the death of Jalal al-Din Mangburni, they were essentially freebooters operating as a mercenary band. They defeated the Aleppine army of al-Mu'azzam Tūrān-shāh, son of Saladin, near B'zaah on 11 November 1240, before taking Manbij. The emir of Homs, al-Mansur Ibrahim newly installed after the death of his father al-Mujahid, brought forces to bear, eventually defeating the Khwarezmians near Edessa on 6 January 1241, sharing the spoils with Badr al-Din Lu'lu', emir of Damascus. The army of Aleppo then combined with a Seljuk force led by Kaykhusraw II to defeat an Ayyubid army led by as-Salih's son and deputy al-Muazzam Turanshah at Amida. The Khwarezmians then allied with al-Muzaffar Ghazi to mount a counterattack, and were defeated at al-Majdal in August 1242. Kaykhusraw II was then dealt a crushing defeat by