During 1640, Abrantes was one of the first lands to declare their support for John IV of Portugal. From the 17th and 18th centuries onwards, its ancient military importance was confirmed, as it was used by Portuguese and foreign armies to garrison or concentrate their forces. The village of Abrantes was captured on 24 November 1807 by French general Jean-Andoche Junot, who was awarded a ducal title for his victory by Napoleon I in 1808, and used as base for further marshaling of French forces. In the Convention of Cintra (22 August 1808) the town was returned to the Portuguese.