a relief army under Henry arrived. Before Branas had time to repair the fortifications, however, in early autumn, Kalojan returned and sacked the city. Henry of Flanders managed to rescue the inhabitants as they were being taken prisoner to Bulgaria, but before he withdrew from the city, Kalojan ordered the town's fortifications razed, making it useless as a military base. In 1225, the city was captured by the ambitious Greek ruler of Epirus and Thessalonica, Theodore Komnenos Doukas, but after his defeat and capture at the Battle of Klokotnitsa in 1230 it fell to Ivan Asen II of Bulgaria. As such, Dimotiko is mentioned in a grant of trading privileges issued by Ivan Asen to the Republic of Ragusa. Finally the Empire of Nicaea returned Didymoteicho to Byzantine control by capturing it around 1243, during the reign of John III Doukas Vatatzes. In 1255/56, Theodore II Laskaris used the city as a base of operations for his campaigns against Bulgaria. The city was once again the centre of military operations in 1306, when Michael IX Palaiologos campaigned against the Catalan Company, and again during the Byzantine civil war of 1321–1328 between Andronikos II Palaiologos() and his grandson, Andronikos III (). The latter made Didymoteicho his main base and residence during the conflict, and the city remained a stronghold and was frequently visited by Andronikos III during his reign. The city also served as a secure place of exile and incarceration of the emperor's opponents, from his uncle Constantine Palaiologos in 1322 to the disgraced chief minister Theodore Metochites in 1328. During the Byzantine civil war of 1341–47, it served as the base of Andronikos III's chief lieutenant, John VI Kantakouzenos (), who was crowned emperor in the city on 26 October 1341. Pressed by his enemies, Kantakouzenos was forced to abandon the city in March 1342, leaving his wife and a few close relatives in charge. With the aid of Umur Bey, ruler of the Turkish beylik of Aydin and owner of a considerable fleet, repeated attempts by the Bulgarian Tsar Ivan Alexander and Kantakouzenos' Byzantine opponents, headed by Alexios Apokaukos, were defeated, and the city remained in his hands throughout the conflict, serving as his main stronghold in Thrace. After the war, the city became part of the Thracian appanage of Matthew Kantakouzenos, who provided it with strong fortifications. In 1352, it was assigned to John V Palaiologos (),