The Mamluks gained control over Syria in the 1260s, and organized the region into kingdoms subordinate to the sultanate in Cairo. Ar-Rastan became the southernmost town of Mamlakat Hama ("Kingdom of Hama") near the border with Mamlakat Hims. In a major battle at a place between the town and Homs, the Mamluks under Qalawun decisively defeated the invading Mongol army of the Ilkhanate in 1281. Later, in the early 14th century, Abu'l-Fida noted that in ar-Rastan, "Each of the houses is so large as to be almost like a village, with ruins everywhere round of buildings and walls." He further noted that a few arches, gates, parts of the city wall and its water channel were still present.