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 was on 1 January 1290. In internal politics he pursued vigorous policies. Mieszko carried out intensive colonizing policies and founded many settlements. He also gave city rights to several towns: Cieszyn, Oświęcim (in 1291), Bielsko, Skoczów and Fryštát. On 10 November 1292 he granted the city rights to Zator. Mieszko refused to support any of the Piast pretenders to the Polish throne (Henry IV Probus, Przemysł II and Władysław I the Elbow-high). Instead he stood alongside King Wenceslaus II of Bohemia. On 17 January 1291 the formal agreement was signed in Olomouc which formed the alliance between the Bohemian Kingdom,