In September 1259, William of Villehardouin was defeated and captured, along with many of his nobles, at the Battle of Pelagonia, by the forces of the Nicaean emperor Michael VIII Palaiologos. Two years later, the Nicaeans recaptured Constantinople, putting an end to the Latin Empire and restoring the Byzantine Empire. At this point, the emperor concluded an agreement with the captive prince: William and his men would be set free in exchange for an oath of fealty, and for the cession of Monemvasia, Grand Magne, and Mystras. The handover was effected in 1262, and henceforth Mystras was the seat of the governor of the Byzantine territories in the Morea. Initially this governor ("kephale") was changed every year, but after 1308 they started being appointed for longer terms. Almost immediately on his return to the Morea, William of Villehardouin renounced his oath to the emperor, and warfare broke out between Byzantines and Franks. The first Byzantine attempts to subdue the Principality of Achaea were beaten back in the battles of Prinitsa and Makryplagi, but the Byzantines were firmly ensconced in Laconia. Warfare became endemic, and the Byzantines slowly pushed the Franks back. The insecurity engendered by the raids and counter-raids caused the inhabitants of Lacedaemon to abandon their exposed city and settle at Mystras, in a new town built under the shadow of the fortress.