Racibórz Castle is a stronghold mentioned in Gesta principum Polonorum of Gallus Anonymus in an entry dated to the year 1108. The first brick sections were likely built around the mid-13th century.

History

It is speculated that the first mention of the Racibórz stronghold dates back to around 845 in a text known as the Bavarian Geographer. It mentions the Golensizi tribe inhabiting the Upper Oder Basin, which had five strongholds. Based on research, it is presumed that one of these strongholds was Racibórz. It is also assumed that it could have been Eburium, the legendary capital of the Quadi. The Latin work Commentarius belli adversum Turcas ad Viennam... by Wespazjan Kochowski, which discusses John III Sobieski's expedition to Vienna, describes the 24th of August, the day when the king arrived at the Racibórz Castle, as follows:From Tarnowskie Góry through Gliwice and Rudy, marching along the road amidst forests to Racibórz, where once was the capital of the Quadi, and later the seat of Polish princes of royal blood, where after passing through, heavy troops were left under the care of Hetman Jabłonowski, and the king, along with a strong army, swiftly entered Austrian territory.Wespazjan Kochowski also mentions Racibórz in the poem published in 1684, where in chapter XLVII one can read:Here [in Tarnowskie Góry] briefly pausing, he [the king] moved where the Quadi once had their capital in Racibórz, from there through the Moravian mountains leading into the land of the Marcomanni, further to Olomouc (...)F.A. Larisch, a German regionalist, believed that Claudius Ptolemy mentioned Racibórz. Władysław K. Zieliński also mentions this in his work Szląsk (pruski) słowem i ołówkiem na podstawie najnowszych źródeł przedstawiony published in 1889:According to Count Larisch, Racibórz was already known as Eburium under Ptolemy, as the capital of the Buri of the tribe of the Suevi [which was the name for the Quadi who invaded Italy and Spain]. This name was probably transformed by the later Slavic inhabitants into Hrad-Ebur or Hrad-Ibur, from which the present name Racibórz (Hrad-Rad-Rac-ibor) originated.

From 11th to 12th century Around the year 1000, there was supposed to be a border fortress in Racibórz. Around 1038, the Racibórz fortress, like the entire Silesia, fell under Czech rule. The Racibórz Castle is first mentioned in Gesta principum Polonorum of Gallus Anonymus in an entry dated 1108. At that time, there was a border castle here. According to the information contained there, the stronghold belonged to the Moravians, and the knights of Bolesław III Wrymouth entered it without a fight, having previously defeated Moravian knights who set out from the stronghold. Racibórz was then a very important stronghold in the defensive system of the Polish-Czech border, so its establishment can be associated with the construction of border fortresses during the conflict between the Piasts and the Premyslids (11th–12th century), rather than with the Golensyts tribe. According to Gallus Anonymus:When Bolesław was guarding the country and striving with all his might for the glory of the homeland, it so happened that the Moravians appeared, wanting to preoccupy the Koźle stronghold in secret from the Poles. At that time, Bolesław sent certain noble knights to occupy, if possible, Racibórz, but he himself did not give up hunting and rest for this reason. These noble knights went away and fought with the Moravians, in which several noble Poles fell in battle, but their comrades took possession of the field of victory and the stronghold. Thus, the Moravians were defeated in battle, and those in the stronghold, unaware of anything, were captured.From 1108 to the beginning of the 14th century, the castle was under the rule of the Piasts. Until the first half of the 14th century, a castellan resided here, and from the end of the 14th century until 1743, it was also the seat of the Racibórz district starosta. From 1172, the castle was also a princely residence. During the reign of Bolesław III Wrymouth, the fortress was one of the important strongholds defending the southern border of the Polish state. Karol Maleczyński dates the founding of the stronghold to the second half of the 10th century, which was corroborated by archaeological research conducted in the castle courtyard. This location was not chosen randomly, as it utilized the natural bend of the Oder river, which was cut off by a river branch to create an island, later called the Racibórz Island. One could get to it via a levee, which is now the route of Zamkowa Street. In 1146, Władysław II the Exile resided at the Racibórz Castle, who was expelled by his brothers. In 1172, Mieszko IV Tanglefoot chose Racibórz as the capital of his principality. His brother, Bolesław I the Tall received Lower Silesia and Opole, while Mieszko received the principality of Racibórz after their father, Władysław II the Exile. During his reign, Racibórz Castle flourished. In 1689, Fryderyk Lucae, a Silesian chronicler, mentions the ruler:There is also the ancient princely castle, which the supreme Polish prince Mieszko [Tanglefoot] built with his wife in 1177, out of concern for his subjects, which stands firmly above the Oder and shines more with ancient monuments than with elegance.

From 13th to 15th century During the reign of Mieszko IV Tanglefoot, a mint producing bracteates with the inscription MILOST (meaning honor or respect) has been operating in the castle since around 1200. This inscription was one of the earliest examples of the Polish language on coins. However, argues that this bracteate is a Lower Silesian coin, and the inscription MILOST may have Czech origins. During Mieszko's rule, a Romanesque castle chapel was also built, which was probably the oldest place of spreading the Christian faith in the Racibórz land. In 1201, as a result of the death of his brother and his son Jarosław, Mieszko took over Opole, creating the Opole-Racibórz Duchy. Racibórz was then the seat of the duchy's court, as indicated by the ruler's title (dux Ratibor, dux Raceburgensis).

In 1211, after the death of Tanglefoot, his son Casimir I took over power in the castle, and during his reign, Opole gained significance, becoming the capital of the duchy. Before 1217, the duke established the left-bank part of Racibórz under Flemish law. After Casimir's death, the regents ruled the duchy, first Henry the Bearded, then the widow of Prince Casimir, Duchess Wiola. In 1222, the Racibórz castellan – Stoigniew – took over. Around 1238, the underage Mieszko became the lord of the Opole-Racibórz Duchy, who resided more often in Racibórz, as indicated by the number of documents issued in this city. Sources indicate a strong fortification of the stronghold, surrounded by a wooden-earth rampart, additionally bordered by the Oder river from the south and its branches from the other sides. The stronghold's fortification is evidenced by the repulsion of the Mongol attack in January 1241. This event is associated with the Racibórz legend of the Mongol leader Tin-fu. According to legend, the alleged castellan, Bartek Lasota, along with a company of warriors, confronted a larger Tatar horde. One of the warriors fatally wounded the Mongolian leader in the throat with an arrow shot from the castle, which contributed to the fleeing besieging troops. To commemorate this event, Mieszko II the Fat commissioned the carving of the Mongolian leader's head in stone, which until World War II was located at the corner, in the southeast wing of the castle, and now is in the . In 1246, the lord of the duchy became Duke Vladislaus I, who also resided more often in the Racibórz Castle. In 1249, the Racibórz stronghold was besieged by the troops of the Olomouc bishop, Bruno von Schauenburg. It was a retaliation for Vladislaus' earlier raid on the Opava land. Attempts to capture the stronghold failed, but the troops burned the city, and Vladislaus had to pay 3,000 silver coins.

After the death of Duke Vladislaus (1281/1282), the castle fell to his youngest son Przemysław. During his time, the castle was rebuilt, and brick buildings were erected, including the castle chapel. From 1285 to 1287, the Wrocław bishop, Tomasz II, resided in the Racibórz stronghold, and got into conflict with the Wrocław duke Henry Probus. In 1288, Tomasz II founded a collegiate chapter at the castle chapel, which was an expression of gratitude for the hospitality shown. This event was described by Jan Długosz in the Chronicles of the Famous Kingdom of Poland:Having gathered a great army consisting of both his own soldiers and mercenaries hired for a monetary contribution, which he exacted as a punishment from the Wrocław church, he militarily invaded the lands of Duke Casimir of Opole and besieged the city of Racibórz due to the presence of Wrocław bishop Tomasz and his clergy therein. Although the wealthier citizens of Racibórz endured the siege for some time and pledged to endure it even longer, the surprised populace, feeling scarcity and lack of food, tormented by hunger, cried constantly, lamented loudly, and sighed, hurling curses and insults at Bishop Tomasz and his clergy. Moved by this, Bishop Tomasz, known for his great kindness, which he allegedly always displayed, said: "Rather let me and my clergy fall into the hands of the tyrant than these innocents perish from hunger. We will immediately free from danger those people who, besieged, are dying from fear and hunger. Let us ward off the destruction threatening this city, which has nourished us and provided us shelter for a long time, either by our imprisonment or – if it pleases God – by our death. Then he put on his liturgical garments and ordered some of the clergy to do the same. And so, in his liturgical vestments and with episcopal insignia, he left the city with all his clergy in exile and proceeded to the tyrant's camp to appease his wrath with the greatest humility. (...) The tyrant, who saw him coming from afar, by the grace of God, was seized with such great fear that he rushed out of his tent as quickly as possible to meet the bishop, fell face down on the ground, and as if seeing something divine in the bishop and revering him as the Eternal Shepherd, begged for forgiveness for his sins. Bishop Tomasz, raising him from the ground, with tears promised to forgive him all his faithlessness, provided that he persevered in this contrition and piety. And after mutual tearful embraces and kisses, the duke and the bishop entered the nearest church of St. Nicholas without witnesses.At the turn of the 12th and 13th centuries, the fortress was rebuilt into a Gothic-style castle. It was also during this time that the wooden palisade on the ramparts was replaced by a wall with fortified towers. According to archaeological research, the first brick buildings can be dated to the second half of the 13th century. Around 1290, Duke Przemysław of Racibórz commissioned the construction of a Gothic chapel, which was dedicated to St. Thomas Becket. The period of prosperity of the castle coincided with the reign of Duke Przemysław and his son Leszek. The building was surrounded by a settlement of fishermen, millers, and craftsmen, which became the nucleus of the later community of . In 1306, when Duke Przemysław died, a physician, Magister Jan, was mentioned at the court. After the death of Duke Przemysław, Leszek of Racibórz became the ruler of the separated Racibórz district.