The Duchy of Racibórz under Duke Mieszko Tanglefoot had been established in 1173 upon the partition of Silesia among the sons of Duke Władysław II the Exile. The bulk of the Silesian lands around Wrocław had passed to Mieszko's elder brother Duke Bolesław I the Tall, leaving the younger dissatisfied. After Bolesław had died in 1201, Mieszko occupied the Duchy of Opole, that had been created for his deceased nephew Jarosław, forming the united duchy of Opole and Racibórz. Bolesław's heir, Duke Henry I the Bearded, had to renounce his claims, whereby the centuries-long division of Upper and Lower Silesia was fixed. The dukes took their residence at the castellany of Opole. Mieszko's son Casimir I of Opole, Duke from 1211, invited German settlers immigrating to his duchy in the course of the Ostsiedlung, and granted German town law to settlements like Leśnica, Ujazd, Gościęcin, Biała and Olesno. As Casimir's successor Duke Mieszko II the Fat was still a minor upon his father's death in 1230, the regency over his duchy was assumed by his uncle Henry I the Bearded, who thereby once again ruled over all Silesia. In 1233 Henry, then High Duke of Poland, granted Mieszko's younger brotherWładysław the Greater Polish lands of Kalisz, which he had seized from Duke Władysław Odonic. However, Henry's plans to push off his nephews ultimately failed: when Mieszko IIcame of age he took over the rule of Opole-Racibórz, defying the claims raised by Henry's heir, High Duke Henry II the Pious. The Greater Polish territories were finally lost to Duke Przemysł I until 1249. In 1246 Mieszko II was succeeded by his brother Władysław, who began to interfere in European politics: at first he supported King Béla IV of Hungary in his conflict with King Ottokar II of Bohemia around the possession of the Imperial Duchy of Austria, not least to attack the neighbouring Moravian lands of Troppau. Nevertheless, King Ottokar prevailed and Władysław switched sides, fighting with his Silesian cousin Duke Henry III the White against King Béla at the 1260 Battle of Kressenbrunn. He also conspired with local nobles in the Polish Seniorate Province of Kraków against High Duke Bolesław V the Chaste resulting in a 1273 rebellion. Władysław failed to gain the Polish throne, nevertheless he could seize large Lesser Polish territories. He helped to free the young Silesian Duke Henry IV Probus from custody, whom his daughter married in 1280. Władysław further encouraged the Ostsiedlung establishing numerous towns like Bytom, Lędziny, Cieszyn, Pszów, Żory, Gliwice and Wodzisław, named after him. He also had to rebuild his residence Opole that had been devastated during the Mongol invasion in 1241. Upon Władysław's death in 1281, his four sons again divided the duchy among themselves. In 1282 both the Duchies of Opole and Racibórz were recreated, with Opole assigned to Bolko, and Racibórz to Przemysław. Those entities which were further split in 1284 and 1290 created the Duchy of Bytom and Duchy of Cieszyn.
In 1521 the Duchy was recreated due to actions of the last Silesian Piast, Jan II the Good. Jan however died without issue in 1532 and the Opole line of the Piasts became extinct, whereafter Opole and Racibórz as reverted fiefs were fully under the sovereignty of the Bohemian Crown. It would then fall to Margrave George of Brandenburg-Ansbach from the House of Hohenzollern, who had signed an inheritance treaty with Jan in 1522 and finally reached the consent of the Bohemian king Ferdinand I of Habsburg. From 1645 until 1666 Opole was held in pawn by the Polish House of Vasa, as it was a dowry of the Polish queen Cecylia Renata, afterward fell back to the Habsburg kings of Bohemia and finally in 1742 it would be annexed and incorporated into the Kingdom of Prussia.