Through his mother, Kunigunde, daughter of Philip of Swabia, he was related to the Holy Roman Emperors of the Hohenstaufen dynasty, which became extinct in the male line upon the execution of King Conradin of Sicily in 1268.
Named after his grandfather King Přemysl Ottokar I, he was originally educated for the role of an ecclesiastical administrator, while his elder brother Vladislaus was designated heir of the Bohemian kingdom.
His father appointed the new heir as Margrave of Moravia, and Ottokar took up residence in Brno, where he was occupied with the reconstruction of the Moravian lands devastated by Mongol raids of 1242.
In 1248, some discontented nobles who supported Emperor Frederick II enticed Ottokar into leading a rebellion against his father King Wenceslaus.
However, Pope Innocent IV excommunicated Ottokar, whereafter Wenceslaus finally managed to defeat the rebels and imprisoned his son at Přimda Castle.
[1] Father and son eventually reconciled to assist the king's aim of acquiring the neighbouring Duchy of Austria, where the last Babenberg duke, Frederick II had been killed in the 1246 Battle of the Leitha River.
That marriage came to an end after half a year with Vladislaus's death in January 1247, and in 1248 Gertrude married the Zähringen margrave Herman VI of Baden.
Wenceslaus released Přemysl Ottokar very soon and in 1251 again made him Margrave of Moravia and installed him, with the approval of the Austrian nobles, as governor of Austria.
To legitimize his position, Přemysl Ottokar married the late Duke Frederick II's sister Margaret of Babenberg, who was his senior by 30 years and the widow of the Hohenstaufen king Henry (VII) of Germany.
Papal mediation settled the conflict : the parties agreed that Ottokar would yield large parts of Styria to Béla in exchange for recognition of his right to the remainder of Austria.
[6] Béla now ceded Styria back to Ottokar, and his claim to those territories was formally recognized by Richard of Cornwall, then king of Germany and nominal ruler of all the German lands.
After Richard of Cornwall died in April 1272 and Pope Gregory X rejected the claims raised by Alfonso of Castile, a new election for the Imperial German throne took place in 1273.
However, the Bohemian king again failed to win the Imperial crown, as the electors voted for the "little count" Rudolf of Habsburg, Ottokar's last and finally victorious rival.
In 1275 Rudolf placed Ottokar under the Imperial ban and besieged his Hofburg residence in Vienna, while a rebellion led by the Vítkovci noble Záviš of Falkenstein disrupted the Bohemian lands.
This compelled Přemysl Ottokar in November 1276 to sign a new treaty by which he gave up all claims to Austria and the neighboring duchies, retaining for himself only Bohemia and Moravia.
He collected a large army to meet the forces of Rudolf and his ally King Ladislaus IV of Hungary in the Battle on the Marchfeld on 26 August 1278, where he was defeated and killed.
He was a founder of many new towns (about 30 — not only in Bohemia, Moravia and Silesia, but also in Austria and Styria) and incorporated many existing settlements through civic charters, giving them new privileges.
Conflict for the title of ownership to these fortified places built by members of nobility was probably the source of an uprising in 1276, which cost Ottokar the Austrian lands, and two years later (in an attempt for reconquest) his life.
The castle housed Bohemian legal records Zemské desky and many spiritual and temporal treasures during the destructive civil strife of the Hussite wars (1419–1434) in Bohemia.
Before his conflict with Rudolf of Habsburg, Ottokar exacted influence over a number of relatives, allies and vassals in Germany, such as the Margraviate of Brandenburg — and spiritual principalities, including the Archbishopric of Salzburg and the Patriarchate of Aquileia.