 After the fall of Cordoba, the Zirids took over Granada in 1013, forming the Zirid kingdom of Granada.The Saqaliba Khayran, with his own Umayyad figurehead Abd ar-Rahman IV al-Murtada, attempted to seize Granada from the Zirids in 1018 but failed.Khayran then executed Abd ar-Rahman IV.