In 741 Leo died and was succeeded as Emperor by his son Constantine V, who almost immediately needed to depart the capital to defend the eastern frontier against the Umayyad Caliphate. Constantine's brother-in-law Artabasdos, who was kouropalates ("master of the palace"), and commanded both the Opsikion theme and the Armeniac theme, took advantage of the new Emperor's absence from the capital to seize the throne. To gain support from those opposed to the iconoclastic policy, Artabasdos reversed it and declared himself the "Protector of the Holy Icons." Patriarch Anastasios quickly switched sides and suddenly became an ardent defender of icons, which Artabasdus reinstalled in the churches. Anastasios even excommunicated Constantine V and declared him a heretic.