section_path: History/718–867
section_name: 718–867
paragraph_text: 718–867
  
  Leo and his son Constantine V (r. 741–775), two of the most capable Byzantine emperors, withstood continued Arab attacks, civil unrest, and natural disasters, and reestablished the state as a major regional power. Leo's reign produced the Ecloga, a new code of law to succeed that of Justinian II, and continued to reform the "theme system" in order to lead offensive campaigns against the Muslims, culminating in a decisive victory in 740. Constantine overcame an early civil war against his brother-in-law Artabasdos, made peace with the new Abbasid Caliphate, campaigned successfully against the Bulgars, and continued to make administrative and military reforms. However, due to both emperors' support for the Byzantine Iconoclasm, which opposed the use of religious icons, they were later vilified by Byzantine historians; Constantine's reign also saw the loss of Ravenna to the Lombards, and the beginning of a split with the Roman papacy.
  
  In 780, Empress Irene assumed power on behalf of her son Constantine VI. Although she was a capable administrator who temporarily resolved the iconoclasm controversy, the empire was destabilized by her feud with her son. The Bulgars and Abbasids meanwhile inflicted numerous defeats on the Byzantine armies, and the papacy crowned Charlemagne as Roman emperor in 800. In 802, the unpopular Irene was overthrown by Nikephoros I; he reformed the empire's administration but died in battle against the Bulgars in 811. Military defeats and societal disorder, especially the resurgence of iconoclasm, characterised the next eighteen years.
  
  Stability was somewhat restored during the reign of Theophilos (r. 829–842), who exploited economic growth to complete construction programs, including rebuilding the sea walls of Constantinople, overhaul provincial governance, and wage inconclusive campaigns against the Abbasids. After his death, his empress Theodora, ruling on behalf of her son Michael III, permanently extinguished the iconoclastic movement; the empire prospered under their sometimes-fraught rule. However, Michael was posthumously vilified by historians loyal to the dynasty of his successor Basil I, who assassinated him in 867 and who was given credit for his predecessor's achievements.