Another major conflict occurred from 1319 to 1326: King Denis's bastard son, Afonso Sanches, lord of nearby Alburquerque was made mayordomo (akin to prime minister) of Portugal, and was nominated preferred heir, by King Denis. Sanches's castle in Alburquerque was clearly visible from Marvão, and his wife's family held nearby lands in La Codosera, making the 'raia' area a power base for Sanches. A civil war (1319-1326) where Denis's legitimate son, the future Afonso IV, rebelled against his father Kind Denis, meant that Marvão and other fortresses on the border would see action ahead of the Battle of Alvalade.