The dukes of Naples were the military commanders of the ducatus Neapolitanus, a Byzantine outpost in Italy, one of the few remaining after the conquest of the Lombards. In 661, Emperor Constans II, highly interested in south Italian affairs (he established his court in Syracuse), appointed a Neapolitan named Basil dux or magister militum. Thereafter a line of dukes, often largely independent and dynastic from the mid-ninth century, ruled until the coming of the Normans, a new menace they could not weather. The thirty-ninth and last duke, Sergius VII, surrendered his city to King Roger II of Sicily in 1137.