In the mid 11th century, the Muslims built the fortifications of this castle, a Muslim governor lived nearby in a palace. Dom Afonso Henriques conquered Lisbon on October 25th, 1147 as part of the Second Crusade. Alfonso’s mercenary army consisted of drunks and thieves and after the victory they ransacked the city. After the victory of Afonso Henriques, it was feared that the Muslim army will attack them again so the defense of the castle was strengthened. The reconstructed castle and its battlements are based on the 11th century Muslim design.
Later, other kings also increased the strength of the defensive system of the castle.