During the time of the Restoration of Portuguese independence, the castle and its location gained importance in view of its border location. For this reason, the location was used as a support base in the context of Portuguese incursions in Galicia by the military forces of Portugal in September 1641. As the war progressed, the castle received modernization and restoration works, which were completed around 1666 (date inscribed on the lintel of a door). It was only three years after briefly falling into the hands of Spanish troops. It is believed that the works have been dragged for a few more decades, since 1720 to date of completion of the main ravelin that defends the main entrance.