238 EARLY MEDIEVAL SPAIN
at least in military terms, of the Leonese kings. He conducted a series
of highly successful raids on Arab strongholds along the frontier, and
won the notable victory at Simancas in 939 over 'Abd al-RaQman Ill's
counter-offensive. He dominated the Rioja, eclipsing the kings of
Pamplona, and the Muslim ruler of Zaragoza submitted himself and
his city, albeit only temporarily, to Leonese authority. In consequence
repopulation could proceed apace: Salamanca was occupied, as was
Ledesma, while Osma, Oca, Clunia and other strongholds in the fron-
tier zone were either founded or restored by local counts on royal
orders.
Ramiro's predecessors had had difficulties with the counts in Castille
and Alava and a number of these had been executed by Ordono II.
Opposition to the new king by two of his counts in particular, Fermin
Gonzalez and Diego Nunez, had led to their capture and imprison-
ment, but it is symptomatic of the local power that such men and
their families were attaining in the vulnerable frontier regions, that
Ramiro found it expedient to release them and restore their offices,
while seeking to gain loyalty by marrying Fernan Gonzalez's daughter
Urraca to his own son and heir Ordono. This alliance was to have
significant consequences, for it involved the ambitious count in the
turbulent dynastic politics of the Leonese rulers in the succeeding
decades.
When Ramiro II died, soon after a final victory over an Umayyad
army at Talavera, his eldest son succeeded as Ordono III (951-956).
Fernan Gonzalez, although father-in-law of the new king, joined in a
conspiracy with King Garcia Sanchez of Pamplona to replace him by
his younger brother Sancho. An attempt to expel Ordono from Leon
failed and the count was forced to take refuge in Castille and submit,
while his daughter was then repudiated by the king. However, Ordono
III, who led a very lucrative raid on Lisbon and showed promise of
continuing his father's successes, died prematurely, to be followed to
the throne by his brother Sancho 'the Fat' (956-958,959-966), whose
obesity led to his expulsion in favour of Ordono 'the Bad' (958-959),
a son of Alfonso IV. This dispute provided opportunities not only for
the Umayyads to make a decisive intervention in 959, but also for the
Count of Castille to further his own independence by playing off the
rival parties. Although formerly the ally of Sancho, he took a promi-
nent part in his expulsion and arranged the marriage of his daughter
Urraca to the new king. When Ordono 'the Bad' was in turn driven
out, Fernan Gonzalez found it expedient to make his peace with the