Poland began to form into a country around the middle of the 10th century in the Piast dynasty. In 966, Prince Mieszko I became a Christian, and so the Polish people also became Christians. The next king was Bolesław I of Poland (called Bolesław the Brave). He conquered many lands and he became the first King of Poland. Casimir I of Poland changed the Polish capital from Gniezno to Kraków. In the 12th century Poland broke into some smaller states after the death of King Bolesław III Wrymouth in 1138 because of his will. Those states were later attacked by Mongol armies in 1241, which slowed down the unification of the small states into the big country of Poland. This happened eighty years later, in 1320, when Władysław I became the King of the United Poland. His son Casimir III the Great reformed the Polish economy, built new castles and won the war against the Ruthenian Dukedom. Many people emigrated to Poland, becoming a haven for emigrants . Many Jewish people also moved into Poland during that time. The Black Death, which affected many parts of Europe from 1347 to 1351, did not come to Poland.