Ottokar was originally educated for the role of an ecclesiastical administrator. However, after Ottokar's older brother Vladislav's death, shortly after the latter's marriage in
1247, Ottokar became the heir. According to popular oral tradition, Ottokar was profoundly shocked by his brother's death and did not involve himself in politics, becoming focused on hunting and drinking. In
1248 he was enticed by discontented nobles to lead a rebellion against his father, King Wenceslaus. During this rebellion he received the nickname "the younger King" (mladší král). The rebellion was defeated and Ottokar imprisoned by his father.
Father and son were eventually reconciled to assist the King's aim of acquiring the neighbouring
Duchy of Austria. The Duchy had been without a ruler since the death of Duke
Frederick II in
1246. Wenceslaus' initial plan of acquiring the duchy was through
his elder son's marriage to the last Duke's niece
Gertrude. That match had been cut short by Vladislav's death and Gertrude's re-marriage to the
Margrave of Baden. The latter was rejected by the Austrian estates and could not establish his rule in Austria. Wenceslaus used this as pretext to invade Austria in
1250 - according to some sources, the estates called upon him in to restore order.
Wenceslaus released his son and in
1251 made him Margrave of
Moravia and, installed him, with the approval of the Austria nobles, as governor of Austria. Ottokar entered Austria, where the estates acclaimed him as Duke. To legitimize his position, Ottokar married the late Duke's widowed sister
Margaret, who was his senior by thirty years and because of her, the engagement of his aunt Agnes (future
Saint Agnes of Bohemia) to
Henry VII of Germany was cancelled.
In
1253, King Wenceslaus died and Ottokar succeeded his father as King of Bohemia. After the death of the German King
Konrad IV, Ottokar also hoped at obtaining the Imperial dignity for himself. His election bid was unsuccessful.