The Mamluk Sultan Qutuz defeated the Mongols at Ain Jalut on 3 September 1260, the whole of Syria became part of the Mamluk Sultanate, Aleppo was the capital of its own province ruled by a Na'ib (Naib), some of these governors revolted and declared their independence in Aleppo like Shams al-Din Aqosh al-Borli who installed al-Hakim I as Abbasid Caliph in order to legitimize his reign while the Sultan Baibars I installed al-Mustansir II, other governors revolted with the aim of ruling the whole sultanate such as Yalbogha al-Nasiri who had Sultan Barquq dethroned in 1389.