In 1273, German princes elected Count Rudolf of Habsburg as king, opposed by Ottokar II of Bohemia. Weakened, Ottokar was forced to resign from the Alpine countries, and war was declared against him. On 26 August 1278, in the Battle on the Marchfeld, Ottokar II was defeated and killed.