The castle had been built to control the ancient city with the same name. The remains of the city (which is on the plains) lies between the village and the castle. The bird's flight distance between the remains and the castle is about 1 kilometre ( mi). During the history the castle had switched hands and partially ruined several times ( Roman Empire , Byzantine Empire , Abbasid Caliphate , Crusaders , Armenian Kingdom of Cilicia , Mamluks of Egypt etc.) . Although the city was evacuated in 1274 following an earthquake  the castle was used by Mamluks.