In 985 the cities of Guimarães and Braga were sacked, and two years later, in a campaign of successive razzias against the Christian kingdoms, Almanzor captured Coimbra, Seia, Viseu and Lamego.
[3] In 1009, after the great fragmentation of the Caliphate of Córdoba, the Taifa of Badajoz became independent,[4] first ruled by a former slave named Sabur, and then usurped by his vizier, Abdallah ibn Al-Aftas, who founded the Aftacid dynasty.
Meanwhile, Gonçalo Trastamires da Maia [pt] took advantage of the internal war between Muslim taifas and retook the city of Montemor-o-Velho, lost in 1026 to Abbad I, and other strategic positions in the region.
[7] Near the ancient Castro Calbo [pt], in the town of Cesar, the Muslim and Christian forces commanded by Bermudo III clashed on 23 March, 1035.
It was only in 1039, with the Beiras Campaign, that there was a real offensive against the Muslim Taifas, in order to retake and reconquer cities such as Lamego, Viseu, Seia and others.