Duke of Poland
Following the death of his father Casimir in 1058, Bolesław II, as the eldest son, inherited Greater and Lesser Poland as well as the Mazovian, Pomeranian, and Silesian lands. His younger brothers Władysław Herman and Mieszko became Governors of the remaining provinces. However Mieszko died relatively early, in 1065, at which point his lands came under the authority of Bolesław II.
His father had left him a stabilised country; Bolesław II continued his foreign policy on surrounding his realm with allied kingdoms in order to prevail against the extensive Holy Roman Empire in the west; he aimed to have Poland eventually bordering only allied countries. This is said to be the main reason behind his numerous foreign interventions: in 1060–1063 he intervened in Hungary to aid his uncle King Béla I in the inheritance conflict with his nephew Solomon, who was backed by his brother-in-law King Henry IV of Germany. As a result, Béla, in 1061, with the support of Polish troops, gained power.
In Hungary, Bolesław II pursued the policy of cooperation with the anti-Imperial faction, which allowed him to gain political independence from the Empire but put him in conflict with Imperial ally, the Duchy of Bohemia. Moreover, he escalated the conflict with the Přemyslid duke Vratislaus II by refusing to pay the annual homage for Silesia and spurring the Bohemian nobility to revolt. In 1063, Bolesław II besieged the then Moravian town of Hradec nad Moravicí but, defeated, he had to retreat. In the end, the relations with Vratislaus II were settled to a certain extent when the latter married Princess Świętosława, Bolesław II's sister.
Benedictine monastery at Mogilno
, founded by Bolesław the Generous
Meanwhile, in 1063, King Béla I of Hungary died. Bolesław II could not defend the cause of his son Géza I against the German troops of Henry IV, who finally installed Solomon on the Hungarian throne. In 1069 Grand Prince Iziaslav I of Kiev and his wife Gertruda, Bolesław's aunt, were overthrown. A Polish military campaign re-established them in power in Kiev.
In 1071 Bolesław II attacked Bohemia again. As he refused any attempt of arbitration by King Henry IV, the question was settled by an armistice between the two belligerents; however Bolesław II, ignoring the treaty, renewed his attack in 1072 and refused to pay the tributes from Silesia to the Holy Roman Empire. Henry IV prepared for a campaign against Poland, but was hit by the outbreak of the Saxon Rebellion in 1073.
Due to his involvement in Hungarian, Bohemian and Kievan affairs, Bolesław II neglected Poland's interests on the Baltic coast. Western Pomerania, therefore, was lost first; and then in either 1060 or 1066 eastern Gdańsk Pomerania (Pomerelia) also severed its ties to the Polish Kingdom.
Gniezno Cathedral, rebuilt by Bolesław the Generous
King of Poland
When Hildebrand of Sovana, an enemy of the German king, became Pope Gregory VII in 1073, Bolesław II saw in him a natural ally; he started to apply the Pope's reforms in the Archbishopric of Gniezno and commenced negotiations to obtain the royal crown. He spurred the ongoing revolt in Saxony, which had forced Henry IV to retreat from that region (he crushed the revolt at the Battle of Langensalza soon thereafter); the Polish king seized the occasion to launch an invasion against Henry IV's vassal, Vratislaus II of Bohemia, alongside an ally from Grand Prince Vladimir II Monomakh of Kiev.
Thanks to his support of the Papal cause during the Investiture Controversy in the Holy Roman Empire, Bolesław II gained the royal crown of Poland: on Christmas Day of 1076 Archbishop Bogumił crowned him in the Gniezno Cathedral in the presence of a Papal legate. King Henry's IV act of contrition at the Walk to Canossa in 1077 included also the Imperial recognition of Bolesław II's royal title. Bolesław's new authority, along with his pride, however, caused the Polish magnates to rebel, as they feared the monarchy had started to grow too powerful.
Deposition and death
In 1077 Bolesław II's troops helped two pretenders to assume the throne: László, another son of Béla I, in Hungary, and again Iziaslav in Kiev. In 1078, while returning from the latter campaign, the Polish troops conquered Red Ruthenia. In 1079, however, the conflict with the Polish nobles culminated into open revolt and Bolesław was deposed and banished from the country. The circumstances that led to the King's banishment hinge on the person of Bishop Stanislaus of Kraków, who had excommunicated the king for his infidelity.
From historical records  it appears that Bishop Stanislaus was involved with the barons' opposition movement, plotting to remove the King and to place his brother Władysław Herman on the throne. Bolesław II unilaterally declared Stanislaus guilty of treason – Gallus Anonymus uses the word "traditor" meaning traitor. The historical record was first proposed by Master Wincenty Kadłubek, writing nearly 100 years after Gallus Anonymus and a century and a half after the actual affair. Bolesław II on 11 April 1079 assaulted and then personally wielded the sword that murdered Bishop Stanislaus of Kraków during the celebration of a Mass. Though the bishop had privately and then publicly warned the king to repent of adultery and other vices, Bolesław chose a course of action more characteristic of his nickname, "the Bold".
Putative tomb of Bolesław at Ossiach
He found refuge at the court of King Ladislaus I of Hungary, a future saint, who also owed his crown to the deposed King. However, according to Gallus Anonymus, Bolesław II's atrocious conduct towards his Hungarian hosts caused his premature death in 1081 or 1082 at the hands of an assassin, probably by poisoning. He was about 40 years old.
A popular legend holds that Bolesław proceeded to Rome to beg forgiveness from Pope Gregory, who imposed on him to wander incognito as a mute repentant. On a summer evening in 1082, he reached the Benedictine Abbey at Ossiach in Carinthia, where he was received and did all kind of hard work until he finally was reconciled in the Sacrament of Penance and died.
At the walls of Ossiach, there exists a tomb bearing the depiction of a horse and the inscription Rex Boleslaus Polonie occisor sancti Stanislai Epi Cracoviensis ("Bolesław, King of Poland, murderer of Saint Stanislaus, Bishop of Kraków"). Instigated by Countess Karolina Lanckorońska, in 1960 the tomb was opened and indeed revealed male bones and the remains of a Polish knight's armor dating from the 11th century.
The legend, however, dates from centuries after the king's death (it was first mentioned by the chronicler Maciej Miechowita in 1499). His burial place actually remains unknown. Another popular hypothesis about the fate of his remains claims that in 1086 they were transferred to the Benedictine abbey of Tyniec near Kraków.