The Mongols under Hulagu Khan had captured and destroyed Baghdad in 1258. In 1260 he sent envoys to Saif ad-Din Qutuz in Cairo demanding his surrender; Qutuz responded by killing the envoys and displaying their heads on the gates of the city. As Qutuz prepared for a Mongol invasion, Hulagu returned home to attempt to seize power when his brother the Great Khan Mongke died. Qutuz allied with a fellow Mameluk, Baibars, who had fled Syria after the Mongols captured Damascus. The Mongols attempted to ally with the remnant of the Crusader Kingdom of Jerusalem, now centred on Acre, but Pope Alexander IV forbade this. The Christians remained neutral.
Both Mameluk and Mongol armies encamped in Palestine in July of 1260. They finally met at Ain Jalut on September 3, with both sides numbering about 20 000 men (the Mongol force was originally much larger, but Hulegu took most of it when he returned home). The Mameluks drew out the Mongol cavalry with a feigned retreat, and were almost unable to withstand the assault. Qutuz rallied his troops for a successful counterattack, along cavalry reserves hidden in the nearby valleys. The Mongols were forced to retreat, and Hulagu's deputy Kitbuqa was captured and executed.
On the way back to Cairo, Baibars killed Qutuz and became sultan himself. His successors would go on to capture the last of the Crusader states in Palestine by 1291.