The Fitna of al-Andalus (Arabic: ) (10091031) was a period of instability and civil war that preceded the ultimate collapse of the Caliphate of Crdoba. It began in the year 1009 with a coup d'tat which led to the assassination of Abd al-Rahman Sanchuelo, the son of Almanzor, the deposition of the Caliph Hisham II al-Hakam, and the rise to power of Muhammad II of Crdoba, great-grandson of Abd-ar-Rahman III. The conflict would eventually divide all of Al-Andalus into a series of Taifa Kingdoms. The Fitna finally ended with the definitive abolition of the Cordoban Caliphate in 1031, although various successor kingdoms would continue to claim the caliphate for themselves. The added pressures of financial collapse were present due to the large tax burden placed on the populace to finance the continuous war.
Throughout the conflict, various Muslim kingdoms were aided by the Christian kingdoms to the north, both in an official capacity and by mercenary Christian soldiers. Crdoba and its suburbs were repeatedly looted during the war, destroying many iconic monuments such as the Alczar de los Reyes Cristianos and the Medina Azahara. The capital was temporarily moved to Mlaga. In a little less than twenty years, 10 different caliphates emerged as successor states to the Caliphate of Crdoba (amongst them was a restored kingdom under Hisham II). Three of these successor kingdoms formed a dynastic succession line known as the Hammudid Dynasty.
The Battle of Aqbat al-Bakr (2 June 1010) was a battle of the Fitna of al-Andalus that took place in the area in and around Espiel, Spain. The battle took place between the forces of the Caliphate of Cordoba, whose forces were commanded by Sulayman ibn al-Hakam, and the Muslim rebel forces of the Catalan-Andalusian alliance trying to overthrow their Caliph overlords under the command of Muhammad ibn Hisham; Wadih al-Siqlabi, governor of al-Tagr al-Awsat; and several West Frankish counts and bishops, including Ermengol I of Urgell, Hugh I of Empúries, and Ramon Borrell of Barcelona.The two armies met at Espiel on 2 June 1010 and the forces of the Caliphate of Cordoba were decisively routed, marking one of the first battles of the war and a significant gain for the rebel Catalan-Andalusian alliance. Although this battle took place in the general time frame of the Spanish Reconquista, it was not unusual for Christian and Muslim forces to join together to achieve common goals.