As a result of the growing discontent with his policy, Boril was overthrown in 1218 by Ivan Asen II, son of Ivan Asen I, who had lived in exile after Kaloyan's death. After his coronation, Ivan Asen II arranged a wedding with Anna Maria, daughter of the Hungarian king Andrew II, and received the captured cities Belgrade and Braničevo as a dowry. He then signed an alliance with Theodore Komnenos, ruler of the most powerful Byzantine successor state, the Despotate of Epirus. With his northern border secured by the treaty, Theodore Komnenos conquered Salonica, greatly reducing the size of the Latin Empire. In 1225, Theodore proclaimed himself emperor. By 1228, the situation for the Latins became desperate; they entered into negotiations with Bulgaria, promising a marriage between the under-age emperor Baldwin II and Ivan Asen II's daughter Helena. This marriage would have made the Bulgarian emperor a regent in Constantinople, but in the meantime the Latins offered the regency to the French nobleman John of Brienne. Concerned with the actions of the Bulgarians, while marching on Constantinople in 1230, Theodore Komnenos invaded Bulgaria with a huge army. Surprised, Ivan Asen II gathered a small force and moved to the south to engage them. Instead of a banner, he used the peace treaty with Theodore's oath and seal stuck on his spear and won a major victory in the Battle of Klokotnitsa. Theodore Komnenos was captured along with his whole court and most of the surviving troops. Ivan Asen II released all ordinary soldiers and marched on the Epyrote–controlled territories, where all cities and towns from Adrianople to Durazzo on the Adriatic Sea surrendered and recognized his rule. Theodore's brother Michael II Komnenos Doukas was allowed to rule in Salonica over the southern areas of the despotate as a Bulgarian vassal. It is possible Serbia accepted Bulgarian suzerainty at that time to counter the threat from Catholic Hungary.