Siege of Granada (1018)
The siege of Granada in 1018 was an attempt by the Umayyad pretender Abd al-Rahman IV and his followers to conquer Granada from Zawi ibn Ziri. Context 
Abd al-Rahman IV had been proclaimed caliph on April 29, 1018. In order to deter an attack on Córdoba, a siege on Granada, where Zawi Ibn Ziri had taken control was decided. Battle 
Abd al-Rahman IV and the commanders Khayran and Mundhir were at the head of 4,000 men. Zawi ibn Ziri had a contingent of 1,000 men, despite being greatly outnumbered he was able to defeat the army of Abd al-Rahman IV with a counterattack that scattered the enemy forces and caused all of the commanders to flee. Consequences 
The counter-attack from Granada sent all three leaders in different directions. The Umayyad pretender Abd al-Rahman IV was later caught at the river Guadix and assassinated. References 

11th century in al-Andalus