Ottokar II (Czech: Přemysl Otakar II), the Iron and Golden King, was a member of the Přemyslid dynasty who reigned as King of Bohemia from 1253 until 1278. He also held the titles of a Margrave of Moravia from 1247, Duke of Austria from 1251, Duke of Styria from 1260, as well as Duke of Carinthia and Margrave of Carniola from 1269.
With Ottokar's rule, the Přemyslids reached the peak of their power in the Holy Roman Empire. His expectations of the imperial crown, however, were never fulfilled.
After Richard of Cornwall had died in April 1272 and the claims raised by Alfonso of Castile were denied by Pope Gregory X, a new election for the Imperial German throne took place in 1273. However, the Bohemian king was again not the successful candidate, as the electors voted for the "little count" Rudolf of Habsburg, Ottokar's last and finally victorious rival.
Přemysl Ottokar refused to acknowledge Rudolf's election, and urged the Pope to adopt a similar policy. At a convention of the Imperial Diet at Nuremberg in 1274, Rudolf decreed that all Imperial lands that had changed hands since the death of the last Hohenstaufen emperor Frederick II must be returned to the crown. This would have deprived Ottokar not only of the Egerland, but also of the Austrian, Styrian, and Carinthian duchies. In 1275 Rudolf placed Ottokar under the Imperial ban and besieged his Hofburg residence in Vienna, while the Bohemian lands were shaken by a rebellion led by the Vítkovci noble Zavis of Falkenstein. 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. Ottokar's son Wenceslaus was also betrothed to Rudolf's daughter Judith. It was an uneasy peace.
Two years later, the Bohemian king made a last attempt to recover his lost lands by force. Přemysl Ottokar again found allies in Bavaria, Brandenburg and Poland. 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. Rudolf had his body laid out in state at the Vienna Minorites Church. In 1297 Ottokar's mortal remains were finally transferred to St. Vitus Cathedral in Prague. His minor son Wenceslaus II succeeded him as King of Bohemia.