The Byzantine Empire had a complex system of aristocracy and bureaucracy, which was inherited from the Roman Empire. At the apex of the hierarchy stood the emperor, yet "Byzantium was a republican monarchy and not primarily a monarchy by divine right". Beneath the emperor, a multitude of officials and court functionaries operated the complex administrative machinery that was necessary to run the empire.