Justinian I, or Justinian the Great, ruled the Byzantine Empire from 527 to 565. The defining achievements of his reign were the compilation and consolidation of the Roman legal code, known as Justinian’s code, and the construction of the church of Hagia Sophia in Constantinople.