Around 830, it became a lordship ruled by hereditary "hypati", or consuls: the first of these was Constantine (839–866), who in 847 aided Pope Leo IV in the naval fight at Ostia. At this same time (846) the episcopal see of Gaeta was founded when Constantine, Bishop of Formiae, fled thither and established his residence. He was associated with his son Marinus I. They were probably violently overthrown (they disappear suddenly from history) in 866 or 867 by Docibilis I, who, looking rather to local safety, entered into treaties with the Saracens and abandoned friendly relations with the papacy. Nevertheless, he greatly expanded the duchy and began construction of the palace. Greatest of the "hypati" was possibly John I, who helped crush the Saracens at Garigliano in 915 and gained the title of "patricius" from the Byzantine Emperor Constantine VII.