In the 18th century, the monastery was severely damaged by lightning. However, it was the Great Lisbon Earthquake of 1755, occurring shortly afterward, that took the heaviest toll on the monastery, reducing it to ruins. For many decades the ruins remained untouched, but they still astonished young prince Ferdinand. In 1838, as King consort Ferdinand II, he decided to acquire the old monastery, all of the surrounding lands, the nearby Castle of the Moors and a few other estates in the area. King Ferdinand then set out to transform the remains of the monastery into a palace that would serve as a summer residence for the Portuguese royal family.