Built by the Moors in the 8th and 9th centuries, the Castle of the Moors played a strategic role in the region. At the time, Sintra was part of Al-Andalus, the Muslim-ruled Iberian Peninsula. In 1147, the castle surrendered to Christian forces. Over the rest of its history, the castle changed hands several times and was damaged in the Lisbon earthquake of 1755. The 19th century brought new life to the medieval fortress, when the defensive parts were secured and rebuilt. Today, there are no castle buildings left, only the walls built along the mountain ridge remain.