 Shortly after, Alfonso VI cunningly defeated a conspiracy of his sons-in-law Raymond and Henry who had plotted to divide the kingdom at his death.In order to antagonize them, he gave Henry and Teresa the government of the County of Portugal, until then ruled by Raymond, which comprised the lands from the Minho river to Santarém, while the government of Raymond was limited to Galicia.In 1097, there was a fourth Almoravid invasion.