782: Harun ibn al-Mahdi (future Harun al-Rashid) leads a huge expedition against the Byzantines and reaches Chalcedon. Harun was nominated as second heir of the Caliphate. 785: Death of the Caliph Mahdi. Accession of Al-Hadi. 786: Alid rebellion in Mecca is suppressed in the Battle of Fakhkh. 786: Death of Hadi. Accession of Harun al-Rashid. 788: Idrisid state set up in the Maghreb. Death of Abd ar-Rahman I of Spain, and accession of Hisham I. 792: Invasion of South France. 796: Death of Hisham in Spain; accession of al-Hakam I. 799: Defeat of an invasion by the Khazars. 800: Musa al-Kazim is poisoned in prison of Harun al-Rashid. Ali al-Rida becomes Imam. Autonomous Aghlabid rule is established in North Africa. By the end of this century, global Muslim population had grown to 2 percent of the total (centred on Iraq). 08