Casimir I the Restorer
By the end of the 10th century, the city was a leading center of trade. Brick buildings were being constructed, including the Royal Wawel Castle with the Rotunda of Sts. Felix and Adauctus, Romanesque churches, a cathedral, and a basilica. Sometime after 1042, Casimir I the Restorer made Kraków the seat of the Polish government. In 1079 on a hillock in nearby Skałka, the Bishop of Kraków, Saint Stanislaus of Szczepanów, was slain by the order of the Polish king Bolesław II the Generous. In 1138, the Testament of Bolesław III Wrymouth came into effect upon his death. It divided Poland into five provinces, with Kraków named as the Seniorate Province, meant to be ruled by the eldest male member of the royal family as the High Duke. Infighting among brothers, however, caused the seniorate system to soon collapse, and a century-long struggle between Bolesław's descendants followed. The fragmentation of Poland lasted until 1320.