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 III the Old several foreign policy successes through his daughter's marriages: Elisabeth about 1173 married Duke Soběslav II of Bohemia and through the dynastic arrangement between his daughter Anastasia and the Griffin duke Bogislaw I of Pomerania, Mieszko once again reinforced Polish sovereignty over the Pomeranian duchy. In 1177 Mieszko's first-born son Odon, fearing for his inheritance, rebelled against his father. He was supported by Bishop Gedko of Kraków, his cousin Bolesław the Tall and his uncle Casimir the Just. For Odon, the main reason of his rebellion was the favoritism of Mieszko to the offspring of his second marriage and the attempts