The Duchies of Silesia were the more than twenty divisions of the region of Silesia formed between the 12th and 14th centuries by the breakup of the Duchy of Silesia, then part of the Kingdom of Poland. In 1335, the duchies were ceded to the Kingdom of Bohemia under the Treaty of Trentschin. Thereafter until 1742, Silesia was one of the Bohemian crown lands and lay within the Holy Roman Empire. Most of Silesia was annexed by the King of Prussia under the Treaty of Berlin in 1742. Only the Duchy of Teschen, the Duchy of Troppau and the Duchy of Nysa remained under the control of the Bohemian crown and as such were known as the Duchy of Upper and Lower Silesia until 1918. Breakup of Polish Silesia (1138–1335) In the (vain) hope to prevent an inheritance dispute, the Piast prince Bolesław III Wrymouth by his last will and testament had divided Poland into hereditary provinces distributed among his four sons: Masovia, Kujawy, Greater Poland and Silesia. Beside which, the Seniorate Province (Lesser Poland) with the residence of Kraków was reserved for the eldest, who according to the principle of agnatic seniority was to be High Duke of all Poland. This act inadvertently started the process known as Fragmentation of Poland. Bolesław's son Władysław II received the Duchy of Silesia and, as the eldest, was also granted the title of a High Duke among with the Seniorate Province. Nevertheless, after he had tried to gain control over all Poland, he was banned and expelled by his younger half-brothers in 1146. Bolesław's second eldest son Bolesław IV the Curly, Duke of Masovia, became Polish High Duke. When, in 1163, Władysław's three sons, backed by Emperor Frederick I Barbarossa returned to Poland, Bolesław IV had to restore their heritage. After ten years of joint rule, Władysław's sons finally divided Silesia in 1173: Bolesław I the Tall, the eldest, received the core territory around the residences of Wrocław, Legnica and Opole. In 1180, he granted the Duchy of Opole to his son Jarosław, who ruled until his death in March 1201. Upon Bolesław's death in December 1201, his lands were inherited by his only remaining son Henry I the Bearded. Mieszko I Tanglefoot became Duke of Racibórz and received Bytom and Oświęcim in 1177. Konrad Spindleshanks (Konrad Laskonogi), the youngest, in 1177 also claimed his rights and received the Duchy of Głogów