an appanage. The rebellious prince allied himself with the Franks and overthrew his uncle in 870. Similarly to his predecessor, Svätopluk I (871–894) assumed the title of the king (rex). During his reign, the Great Moravian Empire reached its greatest territorial extent, when not only present-day Moravia and Slovakia but also present-day northern and central Hungary, Lower Austria, Bohemia, Silesia, Lusatia, southern Poland and northern Serbia belonged to the empire, but the exact borders of his domains are still disputed by modern authors. Svatopluk also withstood attacks of the Magyar tribes and the Bulgarian Empire, although sometimes it was he who hired the Magyars when waging war against East Francia. In 880, Pope John VIII set up an independent ecclesiastical province in Great Moravia with Archbishop Methodius as its head. He also named the German cleric Wiching the Bishop of Nitra. After the death of Prince Svatopluk in 894, his sons Mojmír II (894–906?) and Svatopluk II succeeded him as the Prince of Great Moravia and the Prince of Nitra respectively. However, they started to quarrel for domination of the whole empire. Weakened by an internal conflict as well as by constant warfare with Eastern Francia, Great Moravia lost most of its peripheral territories. In the meantime, the semi-nomadic Magyar tribes, possibly having suffered defeat from the similarly nomadic Pechenegs, left their territories east of the Carpathian Mountains, invaded the Carpathian Basin and started to occupy the territory gradually around 896. Their armies' advance may have been promoted by continuous wars among the countries of the region whose rulers still hired them occasionally to intervene in their struggles. It is not known what happened with both Mojmír II and Svatopluk II because they are not mentioned in written sources after 906. In three battles (4–5 July and 9 August 907) near Bratislava, the Magyars routed Bavarian armies. Some historians put this year as the date of the break-up of the Great Moravian Empire, due to the Hungarian conquest; other historians take the date a little bit earlier (to 902). Great Moravia left behind a lasting legacy in Central and Eastern Europe. The Glagolitic script and its successor Cyrillic were disseminated to other Slavic countries, charting a new path in their sociocultural development. Kingdom of Hungary and Austro-Hungarian Empire (1000–1918) Following the disintegration of the Great Moravian Empire at the turn of the tenth century, the Hungarians annexed the territory comprising