The praefectus urbanus, also called praefectus urbi or urban prefect in English, was prefect of the city of Rome, and later also of Constantinople. The office originated under the Roman kings, continued during the Republic and Empire, and held high importance in late Antiquity. The office survived the collapse of the Western Roman Empire, and the last urban prefect of Rome, named Iohannes, is attested in 599. In the East, in Constantinople, the office survived until the 13th century.
In 753 BC when Romulus founded the city of Rome and instituted the monarchy, he also created the office of custos urbis (guardian of the city) to serve as the king’s chief lieutenant. Appointed by the king to serve for life, the custos urbis served concurrently as the Princeps Senatus. As the second highest office of state, the custos urbis was the king’s personal representative. In the absence of the king from the city, the custos urbis exercised all of his powers, which included the powers of convoking the Senate, the popular assemblies and the exercise of force in the event of an emergency. However, the imperium he possessed was only valid within the walls of Rome.
Under the kings, only three men held the position. The first king Romulus appointed Denter Romulius to serve as the first custos urbis, the third king Tullus Hostilius appointed Numa Martius, and the seventh king Tarquinius Superbus appointed Spurius Lucretius.
After the expulsion of Tarquinius Superbus in 510 BC and the formation of the Republic in 509 BC, the office of custos urbis remained unaltered: having power only within the actual city of Rome and a life term appointed by the consuls. The custos urbis exercised within the city all the powers of the Consuls if they were absent from Rome. These powers included: convoking the Senate and Comitia Curiata, and, in times of war, levying and commanding legions.