 Constructed from taipa, the entrance is defended by a tower and barbican.The castle was taken by Christian forces of King Sancho I, but retaken by the Moors, who kept it until 1248, when knights in the Order of St. James, under Paio Peres Correia, defeated the garrison.By regal charter, on 1 January 1305, King Denis donated the castle and clergy to the Master of Avis, Lourenço Anes; this Order of Avis also occupied Albufeira at the time.