Following 1640, the first Military Governor for Beira was established, D. Álvaro de Abranches da Câmara, who ordered the construction of modern fortifications, "with four or five redoubts, placing within it a Church and the Castle".
King D. John IV ordered his royal engineer, Carlos Lassart, to design and reconnoitre the fortifications in the Entre Douro, Minho and Beira regions.
[3] On 28 February 1643, a royal dispatch ordered Carlos Lassart to, as each fortification was being expanded, leave an official oriented to continue the project.
Sometime around this time, French engineer Pierre Gilles de Saint Paul began serving the Crown within the Beira province, possibly directing some of the work in Almeida.
[3] On 25 February 1645, the Military Governor for Beira was D. Fernando de Mascaranhas, Count of Serém, who immediately ordered that the square be reduced in size.
[3] In 1646, Pierre Girles was substituted in the public works by lieutenant-general Rodrigo Soares Pantoja, and the Governor of the Province immediately ordered the dimensions of the square be reduced.
Similarly, in 1657, D. Rodrigo de Castro, Governor of Almeida, increased work on the fortification, ordering large changes its profile and organization.
[3] The region of Almeida came under the control of Pedro Jacques e Magalhães, Master of the General Camp of the province, who established his post in the town.
[3] In order to safeguard his new post, in 1665, the public works on the fortress were adjudicated to businessmen António Francisco Maio and Domingos Vaz Heredes, but were later (16679 conceded to João Gonçalves and Manuel Fernandes, without discord.
The lull in hostilities did not dissuade Portuguese forces who vigorously continued work on the fortress, beginning with the left lateral walls near the Santo António Gate.
Work had begun on the kitchen in front of the ravelin of Santa Bárbara; correction of the parapets were undertaken, owing to their sub-dimension, eliminating the road the circled it; construction of lateral paths in the walls between the bastions of São João de Deus and Santa Bárbara, and the bulwarks of São Pedro and Santo António; substitution of stone in the battlements and partial reconstruction of the covering.
[3] By June, work on covering the casemates in the bastion of São João de Deus were progressing, although Francisco Maclean has suggested making them bomb-proof.
[8] Known later as the Siege of Almeida, Spanish forces under the command of Count of Aranda lead a major offensive to take control of Portugal.
This advance towards Porto was stalled due to the influx of 8,000 British troops and the Battle of Valencia de Alcántara, events which interfered with Spanish resources and supply lines.
As part of the treaty, on 11 April 1763 Almeida was devolved to Portugal, when Field Marshall Francisco Maclean accepted Spanish surrender, in exchange for the return of Cuba and the Philippines to Spain, which had previously been in the hands of the British.
[3] But, in 1766, a gunpowder magazine was constructed at the bastion of São Pedro, substituting the one that existed on the embankment, along with a similar one at the ravelin of Santa Bárbara.
[3] Spain invaded from the Alentejo and over the following months entered into a stalemate with Portuguese forces at Elvas, Campo Maior, Olivença and Juromenha.
In December 1806, Napoleon decreed the Continental Blockade, imposing on Europe the forced closing of ports to English ships, which Portugal did not accept.
[3] Following Napoleon's brutal repression of the Spanish Dos de Mayo Uprising in Madrid, the Emperor triggered the Peninsular War by ordering a force of 4,000 troops with sixteen cannon across the border to occupy the fortress of Almeida, which despite the earlier French invasion of the country, was still in the hands of the Portuguese.
[3] On 3 March 1817, Beresford ordered that work on the fort should cease and that the fortification should be mined, which began in October, against the wishes of the Governor of Almeida.
[3] These events, ultimately, lead to the 26 May signing of the peace treaty at Evoramonte, forcing D. Miguel into exile, and beginning a period of free Liberal thinking in Portugal.
On 29 June 1847, the Convention of Gramido put an end to the civil war, not before the fortress was taken by revolutionary forces in 1844 interested in reinstating the 1822 Constitution.
[3] In 1853, Marshall Duke of Saldanha, commander of the Portuguese army, named a commission to examine the fortifications at Almeida and decide its military future.
[3] This "golden era" would be short-lived: in September 1893, after public review, the fortress was partially destroyed, during the course of improving the accessibility and converting it from a defense fortification.
As well, the fortress was placed in charge of the Instituto Português do Património Arquitetónico (Portuguese Institute of Architectural Patrimony) by decree 106F/92 (Diário da República, Série 1A), in the same year, resulting in a permanent exhibition dedicated to the 23rd Infantry Regiment, along with activity space for scouts and multi-use halls in the guardhouse of the Santo António Gate was installed in 1996.
[3] The castle is situated in an isolated urban context, implanted on the western limits 7 kilometres (4.3 mi) from the Castela-Leão plateau, 763 metres (2,503 ft) over the valley of the River Côa.
The modern fortification encompasses the older part of the village, covered in vegetation and only open along the military square, while the small bastion of Cruz is punctuated with trees.
Alongside the Cruz gate, is the infantry barracks of Terreiro das Freiras and, immediately nearby, the Church and Hospital of the Misericórdia of Almeida.
On the extreme west of the village centre, at an elevated height, are the foundations of the castle, where a platform has been erected for tourists to view the site.
Between the bastion of São João de Deus is a posterm or false gate, that accesses greenspace flanked by military square.