Aegean islands, depopulating many of them. Five of Thessaly's cities disappear from the sources during the 7th century, and Slavs settled in the northern and northeastern parts of the country. Emperor Constans II () undertook in 658 the first attempt to restore imperial rule, and although his campaign was mostly carried out in the northern Aegean coast, it seems to have led to a relative pacification of the Slavic tribes in southern Greece as well, at least for a few years. Thus during the great Slavic siege of Thessalonica in the tribe of the Belegezitai, who according to the Miracles of Saint Demetrius were settled around Demetrias and Phthiotic Thebes, provided the besieged city with grain. The parts of Thessaly that remained in imperial hands after the Slavic invasions—apparently the Aegean coast and the area around the Pagasetic Gulf—came under the theme of Hellas. This was established between 687 and 695, and comprised the eastern coasts of mainland Greece, and possibly the Peloponnese, as well as Euboea and a few other islands. Its strategos was probably based in (Boeotian) Thebes. Given its lack of depth into the hinterland, the theme was originally probably oriented mostly towards the sea and was of a mostly maritime character, as seen during the anti-iconoclast revolt of 726/7. Some time between 730 and 751, the Church in Thessaly, along with the rest of the Illyricum, were transferred from the jurisdiction of the Pope in Rome to that of the Patriarch of Constantinople. Like much of northern Greece, Thessaly suffered from raids by the Bulgarians, beginning in 773. At the same time, due to conflict between the Bulgarian ruling class and the Slavic population which led to an exodus from the latter, a second wave of Slavic settlement engulfed Greece from on. Unlike the first wave of settlement, this does not seem to have disrupted imperial control in the areas where it had been (re-)established. In 783, however, the eunuch minister Staurakios led a large-scale campaign across Greece from Thessalonica to the Peloponnese, subduing the local Slavs and forcing them to acknowledge imperial overlordship. Despite continued raids by the Bulgarians and Saracen pirates—Demetrias was sacked by Damian of Tarsus in 902 and Thessaly and much of Central Greece devastated by Bulgarian raids in 918 and 923–926—Thessaly, and Greece in general, recovered gradually after Byzantine control was firmly re-established, and there are signs of renewed prosperity and