A few months later, the Mamluks arrived with an army from Egypt and defeated the Mongols in the Battle of Ain Jalut in Galilee. The Mamluk leader, Baibars, made Damascus a provincial capital. When he died, power was taken by Qalawun. In the meantime, an emir named Sunqur al-Ashqar had tried to declare himself ruler of Damascus, but he was defeated by Qalawun on 21 June 1280, and fled to northern Syria. Al-Ashqar, who had married a Mongol woman, appealed for help from the Mongols. The Mongols of the Ilkhanate took Aleppo in October 1280, but Qalawun persuaded Al-Ashqar to join him, and they fought against the Mongols on 29 October 1281, in the Second Battle of Homs, which was won by the Mamluks.