The huge Arab fortress of Ajloun was built in the 12th century and towers over the small market town of the same name. The castle has commanding views over three major wadis leading to the Jordan Valley and was fortified in an attempt to limit the expansion of the Crusader kingdoms. In the 13th century the Mongol invaders destroyed a large portion of the castle but it was restored and expanded by the Mamluks under Sultan Baibars following their victory over the Mongols in 1260. In Ottoman times a garrison of around 50 soldiers inhabited the castle. Earthquakes in 1837 and 1927 badly damaged the structure but the Jordanian Department of Antiquities has done much renovation work in recent years.