Ottokar's parents were Vladislaus II, Duke of Bohemia, and Judith of Thuringia. His early years were passed amid the anarchy that prevailed everywhere in the country. After several military struggles, he was recognized as ruler of Bohemia by Holy Roman EmperorHenry VI in 1192. He was, however, soon overthrown for joining a conspiracy of German princes to bring down the Hohenstaufen dynasty. In 1197, Ottokar forced his brother, Duke Vladislaus III Henry, to abandon Bohemia to him and to content himself with Moravia. Taking advantage of the civil war in Germany between the Hohenstaufen claimant Philip of Swabia and the Welf candidate Otto IV, Ottokar declared himself King of Bohemia in 1198, being crowned in Mainz. This title was supported by Philip of Swabia, who needed Czech military support against Otto. In 1199, Ottokar divorced his wife Adelheid of Meissen, a member of the Wettin dynasty, to marry Constance of Hungary, the young daughter of Hungarian King Béla III. In 1200, with Otto IV in the ascendancy, Ottokar abandoned his pact with Philip of Swabia and declared for the Welf faction. Otto IV and later Pope Innocent III subsequently accepted Ottokar as the hereditary King of Bohemia.
Ottokar was quickly forced back into Philip's camp by the imperial declaration of a new duke of Bohemia, Děpolt III. Subject to his recognition as duke, Ottokar had to allow his divorced wife to return to Bohemia. Having been completed this condition, he again ranged himself among Philip's partisans and still later was among the supporters of the young King Frederick II. In 1212 Frederick granted the Golden Bull of Sicily to Bohemia. This document recognised Ottokar and his heirs as Kings of Bohemia. The king was no longer subject to appointment by the emperor and was only required to attend Diets close to the Bohemian border. Although a subject of the Holy Roman Empire, the Bohemian king was to be the leading electoral prince of the Holy Roman Empire and to furnish all subsequent emperors with a bodyguard of 300 knights when they went to Rome for their coronation. Ottokar's reign was also notable for the start of German immigration into Bohemia and the growth of towns in what had until that point been forest lands. In 1226, Ottokar went to war against Duke Leopold VI of Austria after the latter wrecked a deal that would have seen Ottokar's daughter married to Frederick II's son Henry II of Sicily. Ottokar then planned for the same daughter to marry Henry III of England, but this was vetoed by the emperor, who knew Henry to be an opponent of the Hohenstaufen dynasty. The widowed emperor himself wanted to marry Agnes, but by then she did not want to play a role in an arranged marriage. With the help of the pope, she entered a convent.
Family
Ottokar was married first in 1178 to Adelheid of Meissen, who gave birth to the following children: