an internal innovation. Stephen (1000/1001–1038) established at least eight counties ("vármegye") on the territories of present-day Slovakia: Abov (), Boršod (), Esztergom, Hont, Komárno (), Nitra (), Tekov () and Zemplín () were probably founded by him. The scarcely populated northern and north-eastern territories of today Slovakia became the kings' private forests. King Stephen also set up several dioceses in his kingdom; in the 11th century, present-day Slovakia's territories were divided between the Archdiocese of Esztergom (established around 1000) and its suffragan, the Diocese of Eger (founded between 1006 and 1009). Around 1015, Duke Bolesław I of Poland took some territories of present-day Slovakia east of the River Morava, with Hungarian King Stephen recapturing these territories in 1018. Following King Stephen's death, his kingdom got involved in internal conflicts among the claimants for his crown and Henry III, Holy Roman Emperor also intervened in the struggles. In 1042, the Emperor Henry captured some parts of today Slovakia east of the River Hron and granted them to King Stephen's cousin, Béla, but following the withdrawal of the Emperor's armies, King Samuel Aba's troops recaptured the territories. In 1048, King Andrew I of Hungary conceded one-third of his kingdom (Tercia pars regni) in appanage to his brother, Duke Béla. The duke's domains were centered around Nitra and Bihar (in Romanian: Biharea in present-day Romania). During the following 60 years, the Tercia pars regni were governed separately by members of the Árpád dynasty (i.e., by the Dukes Géza, Ladislaus, Lampert and Álmos). The dukes accepted the kings' supremacy, but some of them (Béla, Géza and Álmos) rebelled against the king in order to acquire the crown and allied themselves with the rulers of the neighbouring countries (e.g., the Holy Roman Empire, Bohemia). The history of the Tercia pars regni ended in 1107, when King Coloman of Hungary occupied its territories taking advantage of the pilgrimage of Duke Álmos (his brother) to the Holy Land. Although, Duke Álmos, when returned to the kingdom, tried to reoccupy his former duchy with the military assistance of Henry V, Holy Roman Emperor, but he failed and was obliged to accept the status quo. Mongol invasion (1241-1242) In 1241, the Mongols invaded and devastated the north-western parts of the kingdom. In April 1241, the Mongolian army crossed the border with Moravia near Hrozenkov. Trenčín Castle resisted the attack, but nearby places were plundered and some of them have