In the early 13th century the ties of the Silesian Piasts with the neighbouring Holy Roman Empire grew stronger as several dukes married scions of German nobility. Promoted by the Lower Silesian Duke Henry I the Bearded, from 1230 also regent over Upper Silesia for the minor sons of his late cousin Duke Casimir I of Opole, large parts of the Silesian lands were settled with German immigrants in the course of the "Ostsiedlung", establishing numerous cities according to German town law. The plans to re-unify Silesia shattered upon the Mongol invasion of Poland and the death of Duke Henry II the Pious at the 1241 Battle of Legnica. Upper Silesia further fragmented upon the death of Duke Władysław Opolski in 1281 into the duchies of Bytom, Opole, Racibórz and Cieszyn. About 1269 the Duchy of Opava was established on adjacent Moravian territory, ruled by the Přemyslid duke Nicholas I, whose descendants inherited the Duchy of Racibórz in 1336. As they ruled both duchies in personal union, Opava grew into the Upper Silesian territory.