King Ottokar II of Bohemia expanded his territories considerably from 1250 to 1273, but suffered a devastating defeat in November 1276, when the newly elected German king Rudolph I of Habsburg imposed the Imperial ban on Ottokar, declaring him an outlaw and took over Ottokar's holdings in Austria, Carinthia, Carniola, and Styria. Ottokar was reduced to his possessions in Bohemia and Moravia, but was determined to regain his dominions, power, and influence. In 1278 he invaded Austria, where parts of the local population, especially in Vienna, resented Habsburg rule. Rudolf allied himself with King Ladislaus IV of Hungary and mustered forces for a decisive confrontation.