The Banu Hud rulers of Zaragosa build the Aljafería fortress and palace. Rodrigo Díaz (El Cid) becomes a mercenary after being exiled by Alfonso IV of Castile. El Cid enters the service of the Muslim rulers of Zaragosa. At the Battle of Almenar in 1082, El Cid’s Zaragosan forces defeat the combined Muslim-Christian army of Valencia, Lerida, Aragón, and Barcelona.