was released by Ivan Asen, who married his daughter, Irene. Theodore returned to Thessalonica, where he easily deposed his brother Manuel and installed his son John Komnenos Doukas as emperor (without a coronation ceremony), but remained the real ruler of the empire in his son's name. The deposed Manuel was sent to exile, but in 1239 he returned with Nicaean aid in an attempt to take back Thessalonica. In the event, an agreement to partition the family possessions was reached: Theodore and John remained in control of Thessalonica, while Manuel received Thessaly. Michael in Epirus was not part of his uncles' agreement, and continued to pursue his own policies independently. In this context he sent an embassy to Emperor Frederick II Hohenstaufen in December 1239, presumably to secure his assistance against his uncles. In 1241 Manuel died, Michael moved in quickly to occupy Thessaly before either of his remaining uncles could react. Michael II's relations with Nicaea ensured his neutrality during the conflict in which John III Doukas Vatatzes conquered Thessalonica and penetrated into northern Greece in 1244–46. In autumn 1246, John III Doukas Vatatzes exploited the accession of the underage Michael Asen (r. 1246–57) to the Bulgarian throne to attack Bulgaria. Within three months, he captured most of Thrace and all of eastern and northern Macedonia. Michael II also took advantage of the opportunity to expand into Albania and northwestern Macedonia. At the close of this campaign, Vatatzes turned on Thessalonica, which he captured with the help of conspirators inside the city. Demetrios Angelos Doukas, who had ruled the city after his elder brother John's death in 1244, was captured and exiled to Bithynia, while Thessalonica and all of Macedonia were placed under the governance of the Grand Domestic Andronikos Palaiologos. With Thessalonica secured, Vatatzes turned to Epirus, offering Michael II a marriage alliance between Michael's eldest son Nikephoros and his own granddaughter Maria. The offer was enthusiastically accepted by Michael's wife, Theodora Petraliphaina, who took Nikephoros with her and went to meet Vatatzes at Pegae. There the young couple was engaged, and a marriage was arranged for the next year, before Theodora and Nikephoros returned to Arta. While his wife supported a close alliance with Nicaea, Michael himself remained ambivalent, as he had not abandoned his family's ambitions. The pro-Nicaean historians consider this stance an indication of his inherent untrustworthiness, but a major factor was the influence of