Almeida originated in the migration of the inhabitants of a Lusitanian castro, located north of the place of Enxido da Sarça, occupied in 61 BC by the Romans, and later by the barbarian peoples. Given its plateau situation, the Arabs called it Al-Mêda (the Table), Talmeyda or Almeydan, having built a small castle (8th-9th century).
In the period of the Reconquest, the Christians definitively took it in 1190 and was successively disputed to Leo, becoming Portuguese possession under the Treaty of Alcanizes in 1297.
Received charter of D. Dinis (1296), which rebuilt the Castle, and new charter of D. Manuel (1510). Next to the castle of rectangular plan and four circular towers, grew the medieval core limited by the walls, whose trace is seen in the Sun Gate, a route that follows the Rua dos Combatentes that defines the old town. In the Castle there was the early Mother Church.
The explosion of the Revelim do Paiol in 1810, motivated by the French invasions, devastated much of the town, and this church was transferred to the Convent of Our Lady of Loreto – which features a baroque portal – taking the name of Our Lady. Candeias, whose procession takes place on 2 February. Popular religiosity is also marked in the footsteps of the Way of the Cross.
The importance of this defensive square has led to urban and institutional expansion and the buildings of the former Artillery Barracks, Vedoria, Court, as well as the Church and Hospital of Misericordia, of chlorine portal – examples of 17th century architecture.
Its stronghold also marked urbanism itself, with blocks intended to house the military, such as the former Cavalry barracks. Of note are the Police Station, built in 1762/69 (in front of which was the military parade, today gardened area), and the famous Casa da Roda – an institution created by Pina Manique in 1783 to collect the exposed children. In the place of the Wheel is a window.
Almeida Fort Square (17th/18th century), a perfect example of Baroque military architecture, is a bastioned fortress with hexagonal star layout, in the style of French engineer Antoine Deville. The access is through the double doors in vaulted tunnel. It has six bastions, with their pillboxes – underground galleries where the population gathered in case of danger and which also served as Miguelist prisons – and revelins, with pits of average depth of 12 m, where a Blood Hospital was also built, and The Military Museum is located.
During the Seven Years War (1756-1763) Almeida returned to Spanish possession, having resumed Portuguese rule in 1763.
In the liberal struggles he took sides with D. Miguel between 1829 and 1832, eventually capitulating after hard fratricidal fights, which again destroyed the walls – rebuilt from 1853. In 1927 the last Cavalry Squadron left Almeida, losing since then military activity which for centuries was the essential reason for its existence.