Around 716, the Visigothic citadel was conquered by the Umayyad Caliphate who reinforced the existing fortifications with a new series of walls. This new period resulted in a great period of development, under the Moorish occupiers, that include the extensive walls in the west.[1][3] In 1160, it was sacked by Ferdinand I of León and Castile, but remained only for a short time in the hand of the Christians: it was quickly recaptured by the Moors.[2] King Sancho I of Portugal, supported by the powerful Crusader army, conquered the city, after a prolong encirclement in 1189.[2] But, a grande army, under orders from Amir al-Mu'minin, in 1191, retook the city.[2] The buildings of the Taifa kingdoms of the 11th century, which includes the Palace of Balconies (where Al-Mutamid, lived as the poet Ibn Amarhe) progressed in the 11th century. The walls and towers that today represent the Castle of Silves came from these campaigns and public works by Almoravides and Almohads in the 12th and 13th centuries.[1][2] The castles internal water catchment, and large rain fed underground cistern were used to provide freshwater for the surrounding dwellings (to as late as the 1920s). It would only be in the 13th century, during the reign of Afonso III of Portugal, that forces under the command of D. Paio Peres Correia, would definitively take the fortress.[2]