Treaty of Badajoz (1267)

[1] This would settle the Portuguese border with Castile until 1801, when another Treaty of Badajoz was signed, when Portugal ceded a number of territories, including the town of Olivença.

[2] The Treaty of Badajoz has its origins in territorial disputes, primarily over claims to Algarve, and dynastic struggles among the Christian kingdoms of Castile and Portugal during the 13th century.

[3] In 1226, Sancho II of Portugal and the Portuguese military orders initiated a southward territorial expansion against the taifas of Al-Andalus, conquering the Alentejo region.

The king took advantage of the taifa's weakness, Castile's distractions with their primary focus on the Guadalquivir valley and unclear Castilian jurisdiction over the region.

With this incursion, Portugal conquered Aroche and Aracena and completed the conquest of the lands in Algarve, including Albufeira, Loulé, Tavira and Faro.

The Castilian king asserted their claim to the region by visiting to the borderlands, restoring the bishopric of Silves and granting the disputed towns of Aroche and Aracena to the council of Seville.

[6] While Denis held the right to the lands in Algarve, it was Alfonso III who effectively controlled them, as highlighted by the forals (charters) given to the towns of Silves, Tavira, Faro, and Loulé.

[3] The Treaty of Badajoz was signed on February 16, 1267 and it led to an agreement over part of the border between Portugal and Castile, a formal renouncing of Castilian claims to Algarve and an affirmation of Portuguese sovereignty.

[8][3] North of the boundary line, Portugal was able to maintain Arronches, Alegrete, and Elvas, but was forced to capitulate Valencia de Alcántara and Marvão.

Afonso III of Portugal, painting from 1639, centuries after his death
Iberia in 1240
Taifa of Niebla
Alfonso X of Castile
Denis of Portugal