But, between 1580 and 1640, the defensive structures began to decay and fall into ruin. Following John IV of Portugal's restoration of the Crown of Portugal, on 1 December 1640, the monarch sought to consolidate and strengthen his throne, making decisions to strengthen his military control of the territory. He created a "Council of War" to organize the Kingdom's security along with a "Junta of the Frontiers". This Junta had the responsibility of reviewing and strengthening the existing fortresses near the border. One of the Junta's projects was the construction of a new defensive structure at Almeida.