The Crisis of the Piast dynasty was a period of constant wars, invasions and rebellions, lasting from the death of Bolesław the Brave in 1025 until the reunification of the Polish lands by Casimir the Restorer. During the crisis, Poland suffered very severe material and demographic losses, the Polish capital Gniezno was completely destroyed, Lusatia and Milsko were taken over by the Germans, Bełz by Kievan Rus, Principality of Nitra by Hungary and Moravia and initially Silesia by Bohemia. This period ended in 1058 after Casimir the Restorer unified the country, but the Polish state was greatly weakened.

Death of Bolesław the Brave (1025) After the death of Bolesław the Brave in 1025, his second son Mieszko II Lambert became the new ruler of Poland, to the displeasure of his two brothers. Both, overlooked by his father, his older son Bezprym and his younger son Otto Bolesławowic laid claim to a share in power. Mieszko II immediately crowned himself second king of Poland, a move that was not enthusiastically welcomed in the Holy Roman Empire, where the vision of a strong Polish kingdom independent of the Empire was disliked among the elite there.

Mieszko inherited a vast state from his father, encompassing Lusatia, which was claimed by the Empire, the Cherven Cities, which Kievan Rus was trying to regain, and perhaps Moravia, which the Bohemians wanted to regain. Relations with Hungary were also hostile after the wars fought during his father's reign. Independent since about 1005, pagan Western Pomerania, Prussia and Polabia, remembering Bolesław's attempts to seize them, were also hostile to Christian Poland, so Mieszko had enemies himself on all borders. Also in the country, the number of the king's opponents was growing. In addition to the brothers mentioned earlier who were jealous of the throne, there was also a growing class of magnates, reluctant to have a strong central authority, over the pagan population imposed from above by the ecclesiastical institutions managed at the time largely by foreigners who did not speak the native language.

Despite the problems, however, Mieszko tried to continue the policy of Bolesław, meddling in the internal affairs of the Holy Roman Empire, establishing cooperation with the opposition there, thus emphasizing his independence.Poczet królów i książąt polskich, Stanisław Rosik i Przemysław Wiszewski, str.25

Turmoil in the Holy Roman Empire After the death of Henry II, Conrad II of the Salian dynasty was elected and crowned as the new German king in Mainz on September 8, 1024. Although the election was unanimous, several vassals delayed paying tribute to the new ruler. Among them was the Duke of Lorraine. In 1026, Conrad II traveled to Italy for the imperial coronation. His absence increased the activity of the anti-Emperor opposition in Germany, centered around Ernest II, Duke of Swabia, and Frederick II of Lorraine. Conrad II's opponents tried to find favor with foreign rulers, including the French King Robert II the Pious.

Mieszko's raid on Saxony (1028) In January 1028, Polish troops invaded Saxony. Mieszko's team struck Meissen, where his sister, Margravine Regelinda, probably ruled. In addition to loot, a considerable number of captives were abducted, including the captured bishop of Brandenburg, Luizon, who probably died in Polish captivity. Mieszko II obtained the help of Count Siegfried, son of the Margrave of the Eastern March Odo, in the fighting. Mieszko's goal was to exploit antagonisms between German lords.

First German invasion of Poland (1029)

The emperor accused the Polish ruler of an illegitimate coronation and declared him a usurper. Despite the treaty that was supposed to ensure peace between Poland and Germany, Conrad II soon organized a retaliatory expedition against Mieszko. The invasion must have also affected the lands of the Slavic tribe of the Veleti. In October 1028, their envoy arrived at the state convention in Pöhlde, asking the emperor for protection from Mieszko II's incursions and promising support in the fight against the Polish ruler. In the autumn of 1029, the army of Conrad II entered Lusatia and laid siege to Bautzen, but the German army did not receive the promised support from the Veleti and the expedition failed - the Polish garrison held the city despite heavy losses. Threatened by the Hungarians, the Emperor was forced to retreat.

German-Bohemian-Ruthenian-Hungarian coalition against Mieszko II (1030–1031)

It is likely that after Mieszko II took power, his two brothers were still in Poland for a short time. Soon both Otto and Bezprym found themselves outside the country. Either they were exiled by Mieszko II when he detected that they were conspiring against him with Emperor Conrad II, or they left Poland voluntarily. According to one hypothesis, Otto went to Germany probably to his sister, Regelinda, and Bezprym went to Ruthenia. It was probably Bezprym who first took advantage of Mieszko II's plight and assembled a German-Ruthenian-Hungarian-Bohemian coalition against him. The two went, probably in 1029, to Ruthenia, where they informed the Ruthenian prince Yaroslav the Wise of the military weakness of the Polish state and prompted him to attack and recapture the territories seized earlier during Bolesław the Brave's expedition to Ruthenia, and then brokered an alliance with the emperor.

Mieszko's second raid on Saxony (1030) In 1030, Mieszko II formed an alliance with Hungary, after which he again invaded Saxony. Count Siegfried, who fought on the side of the Polish king, was killed in this campaign. Meanwhile, Mieszko's southern ally attacked Bavaria, temporarily occupying Vienna in Austria. In response, the emperor began to organize another retaliatory expedition against the Polish king, this time organizing a broader coalition. The Germans probably supported Prince Otto Bolesławowic in his claim to the Polish throne, while the Ruthenians supported Bezprym.

Capture of Bełz by Kievan Rus' (1030) According to one of the oldest Old Ruthenian Chronicles, "Primary Chronicle," in 1030 Yaroslav the Wise went on the offensive in the east, seizing the border town of Bełz with great success.

German-Bohemian-Ruthenian invasion of Poland (1031) The emperor in 1031 made peace with Hungary, at the time allied with Mieszko II. It is likely that Stephen I, who ruled there, occupied Slavonia in return. Conrad II no longer had to fear an attack from the south and in the autumn of 1031 launched an offensive on Lusatia and Milsko. This time the German invasion was successful, and Mieszko II was forced to relinquish some lands. As a result, Bolesław the Brave's conquests, over which he had waged years of war with Henry II fell away from Poland.

While Mieszko II was busy defending Lusatia in the west, an armed expedition was coming from the east, led by Yaroslav the Wise and Mstislav the Brave, supported by the future Norwegian king Harald III. In 1031, they captured the strongholds of the ''Lachs" as far as the San and annexed the Cherven Cities to their country.

Mieszko II's escape to Bohemia (1031) Threatened by invaders, Mieszko was forced to flee the country. He was unable to flee to Hungary, as the way was blocked by Ruthenian troops, and King Stephen of Hungary was not in his favor. Deprived of alternatives, Mieszko set out for Bohemia. There he was imprisoned and castrated at the behest of Prince Oldřich, as punishment for Bolesłav the Brave's blinding of Bohemian Prince Boleslaus III the Red.

Bezprym's rule (1031–1032) Mieszko's escape and imprisonment effectively marked the end of the conflict and the defeat of Poland. The invaders installed Bezprym, who was favorable to them, on the Polish throne, and immediately returned the royal crown to Conrad II, which meant the marginalization of the Piast state back to the role of a duchy, and the status of the kingdom would only be restored almost half a century later by Mieszko II's grandson Bolesław the Bold.

As a result of losing the war, Poland lost the territories of Lusatia, Milsko to Germany, Cherven Cities to Kievan Rus and probably Moravia to Bohemia and Slovakia to Hungary.

The defeat was also the beginning of a crisis that almost led to the collapse of the barely established Piast state. After Mieszko II fled and Bezprym seized power, Mieszko's wife Richeza went into exile in Germany with her sons, taking with her the Insignia of the monarch, sent back to the Emperor by Bezprym.

Assassination of Bezprym (1032) According to sources, Bezprym's short reign was marked by extraordinary cruelty, the authority of the government collapsed. The state, as a result of his actions, was significantly weakened. The influence of the Holy Roman Empire on Polish affairs increased. According to the ''Hildesheim Annals'', he died murdered in the spring of 1032, probably inspired by Otto and Mieszko.

After Bezprym's death, as agreed at the Merseburg congress, Poland was divided into three parts that year. Mieszko II regained power as prince of one of the three districts. After the death of Otto and Bezprym, he reunited the state in 1033, but failed to regain the crown or restore stable structures of monarchical power.

During his reign, the so-called pagan reaction took place.

Pagan Uprising (1032)

Religion in Poland prior to christianization Polytheism, worship of Svarog, the sky god, prevailed in the Polish lands before the adoption of Christianity. The forces of nature identified with many deities were worshipped, as well as the spirits of ancestors. Some deities occurred simultaneously among many tribes, while others, with a local scope, were given special reverence only within a single tribe or even a neighboring association. Similarly, each family had its own ancestral spirits. Professing polytheism, the Slavs believed that the god of a foreign tribe was just as real as the god of their tribe. The practice of Slavic religion allowed for the possibility of abandoning the worship of a particular deity in favor of another if that deity were to prove stronger.

Baptism of Poland was primarily political, and Mieszko I's behavior at the time testifies to his great discernment and foresight. In the short term, it allowed him to solidify his alliance with Bohemia, and in the long term, it had the effect of consolidating his power by religiously legitimizing it and, at the same time, helped solidify the independent position of the Polish state in Christian Europe.

After the adoption of Christianity, clergy began to be drawn to Poland. This was beneficial for the development of the country, as they were the best educated people of the time. They taught the new religion, and also introduced Latin writing to Poland. This gave rise to written literature in the Polish lands. Monasteries and churches were centers of intellectual and artistic life. The clergy also knew the secrets of farming. They taught the Polans how to drain wetlands, introduced new tools and the two-field system, which led to the development of farming. The adoption of Christianity contributed to the development of construction. Romanesque stone churches were built, which initiated a new style in architecture previously unknown in the Polish lands. Sacred painting and sculpture appeared. In time, cathedral schools were also established, which educated young people.

On the other hand, however, for the inhabitants of settlements far from the centers, brought up in pagan culture, the Christian faith remained foreign despite baptism. In 966, apart from Mieszko, only his immediate circle was baptized. After the arrival of Jordan's mission, mass baptisms of the members of Mieszko's team and the inhabitants of the suburbs were arranged. However, despite the Christianization missions - including even the later ones carried out by Otto of Bamberg in 1124-1125 and 1128 - the majority of the population in practice still remained pagans.