In 1250 a crisis within the Ayyubid state led to the rise of the Mamluks to power and a transition to the Mamluk Sultanate, which is divided between the Bahri and Burji periods. The Ayyubids tried to hold on to power in Syria, but the Mongol invasion of 1260 put an end to this. A Mamluk army defeated the Mongol incursion and in the aftermath Baybars, the true founder of the Mamluk state, emerged as ruler of Egypt, the Levant, and the Hijaz. The Mamluks ruled over Palestine including Jerusalem from 1260 until 1516. In the decades after 1260 they also worked to eliminate the remaining Crusader states in the region. The last of these was defeated with the capture of Acre in 1291.