Almeida, Portugal the current name was first used, in the form of the Arabic "al-Ma'ida" ('the plateau'). The village of Almeida was captured from the Moors by the second king of Portugal, Sancho I in the 12th century because of its strategic position on the new country of Portugal's border with Spain. So important to the security of the country, Sancho had the village heavily fortified. The castle was refortified on three further occasions by King Dinis, King Manuel I and by King João VI. The present 12 pointed star fortification was constructed in 1641 to a Vaubanesque plan on which the
Border of Granada other municipalities in the Huelva province, which include ""de la Frontera"" in their names. However, these do not refer to the Border of Granada border, but to the border with Portugal. This is the case with Rosal de la Frontera and Palos de la Frontera. The first frontier was defined by the Pact of Jaén in 1246 between Muhammad I "ibn al-Ahmar", first king of Granada, and King Fernando III 'El Santo', following extensive conquests by the latter in the valley of the Guadalquivir. The border then went through modifications during the reigns of Sancho IV, Fernando IV and Alfonso