Poland to form into a recognizable unitary and territorial entity around the middle of the 10th century under the Piast dynasty. Poland's first historically documented ruler, Mieszko I, accepted Christianity with the Baptism of Poland in 966, as the new official religion of his subjects. The bulk of the population converted in the course of the next few centuries. In 1000, Boleslaw the Brave, continuing the policy of his father Mieszko, held a Congress of Gniezno and created the metropolis of Gniezno and the dioceses of Kraków, Kołobrzeg, and Wrocław. However, the pagan unrest led to the transfer of the capital
Mieszko I, Duke of Cieszyn shelter to the Bishop in Raciborz. His politics against Henry IV were reinforced when the Duke of Wrocław repudiated his wife Constance —sister of Mieszko— and sent her back to her homeland. Another consequence of Mieszko's politics was an armed expedition of Henry IV in 1287 against Racibórz, who was sieged. Then Mieszko was forced to refuse his help to the Bishop. In 1290 the division was made of the Duchy of Racibórz: Przemysław retained Racibórz and Mieszko obtained the rule over the districts of Cieszyn, Oświęcim and Zator. The first time that he signed himself as Duke of Cieszyn