section_path: Early Middle Ages/Byzantine survival
section_name: Byzantine survival
paragraph_text: Byzantine survival
  
  The Eastern Roman Empire remained intact and experienced an economic revival which lasted into the early 7th century. Political life was marked by closer relations between the political state and the Christian Church, with theological matters assuming an importance in Eastern politics that they did not have in Western Europe. Legal developments included the codification of Roman law; the most comprehensive compilation, the Corpus Juris Civilis, was made under Emperor Justinian (r. 527–65). The Byzantines regularly employed eunuchs for administrative tasks or as guardians or tutors of women and children, since they considered castrated men exceptionally intelligent and loyal servants.
  
  Justinian nearly died during the Nika riots, a popular revolt that destroyed half of Constantinople in 532. After crushing the revolt, he reinforced the autocratic elements of the imperial government and mobilised his troops against the western Arian kingdoms. The general Belisarius (d. 565) seized North Africa from the Vandals and attacked the Ostrogoths, but his campaign was interrupted by an unexpected Sasanian invasion from the east. Between 541 and 543, a deadly outbreak of plague decimated the empire. Justinian developed an extensive system of border forts to compensate for the lack of military personnel, but stopped maintaining the public roads. He resumed his expansionism in a decade, completing the conquest of the Ostrogothic kingdom and seizing much of southern Spain from the Visigoths.
  
  Justinian's re-conquests and building program have been criticised by historians for bringing his realm to the brink of bankruptcy, but many of the difficulties faced by his successors were due to other factors (including the massive expansion of the Avars and their Slav allies). Eastern border defences collapsed during a new war with the Sasanian Empire, and the Persians seized Egypt, Syria, and much of Anatolia. The Avars, Slavs and Persians attacked Constantinople in 626, but could not conquer it. Emperor Heraclius (r. 610–41) launched an unexpected counterattack against the heart of the Sassanian Empire two years later, recovering the territories previously lost to the Persians.