The Duchy of Silesia (, , ) with its capital at Wrocław was a medieval duchy located in the historic Silesian region of Poland. Soon after it was formed under the Piast dynasty in 1138, it fragmented into various Silesian duchies. In 1327, the remaining Duchy of Wrocław as well as most other duchies ruled by the Silesian Piasts passed to the Kingdom of Bohemia as Duchies of Silesia. The acquisition was completed when King Casimir III the Great of Poland renounced his rights to Silesia in the 1335 Treaty of Trentschin. Geography During the time of its establishment, the Silesian lands covered the basin of the upper and middle Oder river. In the south the Sudetes mountain range up to the Moravian Gate formed the border with the lands of Bohemia - including Kłodzko Land - and Moravia. After a more than century-long struggle, the boundary had just been determined by an 1137 agreement with the Bohemian duke Soběslav I. In the west Lower Silesia bordered on the German March of Lusatia (later Lower Lusatia) and the former Milceni lands around Bautzen (later Upper Lusatia) with the boundary running along the Bóbr and Kwisa rivers. Silesia was limited by the Polish provinces of Greater Poland in the north and the Seniorate Province of Lesser Poland in the east, separated by the Przemsza and Biała rivers. The boundaries varied slightly in the following decades: at least when the duchy was re-established for the sons of Władysław II the Exile in 1163 (see below), it also comprised Lubusz Land northwest of Krosno, which had been the western outpost of Greater Poland and passed to the margraves of Brandenburg in 1248. In 1177 the Polish High Duke Casimir II the Just attached the former Lesser Polish castellanies of Bytom, Oświęcim, Zator, Siewierz und Pszczyna to Upper Silesia in favour of Duke Mieszko IV Tanglefoot. After Silesia as a whole had become a Bohemian fief according to the 1335 Treaty of Trentschin, these lordships – except for the state countries of Bytom and Pszczyna – returned to the Polish Crown. History As the Silesian Province (), the duchy was one of five main provinces established in medieval Poland according to the Testament of Bolesław III Krzywousty. By the terms of the will from 1138–1146 it was controlled by the Senior Duke of Poland or High duke, Bolesław's first-born son Władysław II the Exile,