Both were the mere puppets of factions, who deserted them at once. Abd-ar-rahman IV was murdered in the year in which he was proclaimed, at Guadiz, when fleeing from a battle in which he had been deserted by his supporters. Abd-ar-Rahman V was proclaimed caliph in December 1023 at Cordova, and murdered in January 1024 by a mob of unemployed workmen, headed by one of his own cousins.