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.
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.
Abd al-Rahman IV and the commanders Khayran and Al-Mundhir ibn Yahya al-Tujibi were at the head of 4,000 men. Zawi ibn Ziri had a contingent of 900 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.
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.