Finding all hopes of accommodation frustrated, Rudolph prepared for a conflict, in which, like Cæsar, he was not to fight for victory alone, but for life. At the dawn of day, August 26, 1278, his army was drawn up, crossed the rivulet which gives name to Weidendorf, and approached the camp of Ottocar. He ordered his troops to advance in a crescent, and attack at the same time both flanks and the front of the enemy, and then, turning to his soldiers, exhorted them to avenge the violation of the most solemn compacts and the insulted majesty of the empire, and by the efforts of that day to put an end to the tyranny, the horrors, and the massacres to which they had been so long exposed. He had scarcely finished before the troops rushed to the charge, and a bloody conflict ensued, in which both parties fought with all the fury that the presence and exertions of their sovereigns or the magnitude of the cause in which they were engaged could inspire. At length the imperial troops gained the advantage, but in the very moment of victory the life of him on whom all depended was exposed to the most imminent danger.

Several knights of superior strength and courage, animated by the rewards and promises of Ottocar, had confederated either to kill or take the King of the Romans. They rushed forward to the place where Rudolph, riding among the foremost ranks, was encouraging and leading his troops, and Herbot of Fullenstein, a Polish knight, giving spurs to his horse, made the first charge. Rudolph, accustomed to this species of combat, eluded the stroke, and, piercing his antagonist under his beaver, threw him dead to the ground. The rest followed the example of the Polish warrior, but were all slain, except Valens, a Thuringian knight of gigantic stature and strength, who, reaching the person of Rudolph, pierced his horse in the shoulder, and threw him wounded to the ground. The helmet of the King was beaten off by the shock, and being unable to rise under the weight of his armor he covered his head with his shield, till he was rescued by Berchtold Capillar, the commander of the corps of reserve, who, cutting his way through the enemy, flew to his assistance. Rudolph mounted another horse, and, heading the corps of reserve, renewed the charge with fresh courage, and his troops, animated by his presence and exertions, completed the victory.

Ottocar himself fought with no less intrepidity than his great competitor. On the total rout of his troops he disdained to quit the field, and, after performing incredible feats of valor, was overpowered by numbers, dismounted, and taken prisoner. He was instantly stripped of his armor, and killed by some Austrian and Styrian nobles whose relations he had put to death. The discomfited remains of his army, pursued by the victors, were either taken prisoners, cut to pieces, or drowned in their attempts to pass the March; and above fourteen thousand perished in this decisive engagement.

Rudolph continued on the field till the enemy were totally routed and dispersed. He endeavored to restrain the carnage, and sent messengers to save the life of Ottocar, but his orders arrived too late, and when he received an account of his death he generously lamented his fate. He did ample justice to the valor and spirit of Ottocar; in his letter to the Pope, after having described the contest and the resolution displayed by both parties either to conquer or die, he adds: "At length our troops prevailing drove the Bohemians into the neighboring river, and almost all were either cut to pieces, drowned, or taken prisoners. Ottocar, however, after seeing his army discomfited and himself left alone, still would not submit to our conquering standards, but, fighting with the strength and spirit of a giant, defended himself with wonderful courage, until he was unhorsed and mortally wounded by some of our soldiers. Then that magnanimous monarch lost his life at the same time with the victory, and was overthrown, not by our power and strength, but by the right hand of the Most High."

The body of Ottocar, deformed with seventeen wounds, was borne to Vienna, and, after being exposed to the people, was embalmed, covered with a purple pall, the gift of the Queen of the Romans, and buried in a Franciscan convent.

The plunder of the camp was immense, and Rudolph, apprehensive lest the disputes of the booty and the hope of new spoils should occasion a contest between his followers and the Hungarians, dismissed his warlike but barbarous allies with acknowledgments for their services, and pursued the war with his own forces. He took possession of Moravia without opposition, and advanced into Bohemia as far as Colin.

The recent wars, the total defeat of the army, and the death of Ottocar had rendered that country a scene of rapine and desolation. Wenceslaus, his only son, was scarcely eight years of age; and the Queen Cunegunda, a foreign princess, was without influence or power; the turbulent nobles, who had scarcely submitted to the vigorous administration of Ottocar, being without check or control, gave full scope to their licentious spirit; the people were unruly and rebellious, and not a single person in the kingdom possessed sufficient authority to assume and direct the reins of government. In this dreadful situation Cunegunda appealed to the compassion of Rudolph, and offered to place her infant son and the kingdom under his protection. In the midst of these transactions Otho, Margrave of Brandenburg and nephew of Ottocar, marched into Bohemia at the head of a considerable army, took charge of the royal treasures, secured the person of Wenceslaus, and advanced against the King of the Romans.

Rudolph, weakened by the departure of the Hungarians and thwarted by the princes of the empire, was too prudent to trust his fortune to the chance of war; he listened therefore to overtures of peace, and an accommodation was effected by arbitration. He was to retain possession of the Austrian provinces, and to hold Moravia for five years, as an indemnification for the expenses of the war; Wenceslaus was acknowledged King of Bohemia, and during his minority the regency was assigned to Otho; Rudolph, second son of the Emperor, was to espouse the Bohemian princess Agnes; and his two daughters, Judith and Hedwige, were affianced to the King of Bohemia and to Otho the Less, brother of the Margrave. In consequence of this agreement Rudolph withdrew from Bohemia, and in 1280 returned to Vienna in triumph. Being delivered from the most powerful of his enemies, and relieved from all further apprehensions by the weak and distracted state of Bohemia, he directed his principal aim to secure the Austrian territories for his own family. With this view he compelled Henry of Bavaria, under the pretext of punishing his recent connection with Ottocar, to cede Austria above the Ems, and to accept in return the districts of Scharding, Neuburg, and Freistadt as the dowry of his wife.

But, though master of all the Austrian territories, he experienced great difficulties in transferring them to his family. Some claimants of the Bamberg line still existed: Agnes, daughter of Gertrude and wife of Ulric of Heunburg, and the two sons of Constantia by Albert of Misnia. Those provinces were likewise coveted by Louis, Count Palatine of the Rhine, and by his brother Henry of Bavaria, as having belonged to their ancestors, and by Meinhard of Tyrol, from whom he had derived such essential assistance, in virtue of his marriage with Elizabeth, widow of the emperor Conrad and sister of the Dukes of Bavaria. The Misnian princes, however, having received a compensation from Ottocar, withheld their pretensions, and Rudolph purchased the acquiescence of Agnes and her husband by a sum of money and a small cession of territory. He likewise eluded the demands of the Bavarian princes and of Meinhard by referring them to the decision of the German diet, In the mean time he conciliated, by acts of kindness and liberality, his new subjects, and obtained from the states of the duchy a declaration that all the lands possessed by Frederick the Warlike belonged to the Emperor, or to whomsoever he should grant them as fiefs, saving the rights of those who within a given time should prosecute their claims. He then intrusted his son Albert with the administration, convoked, on August 9, 1281, a diet at Nuremberg, at which he presided in person, and obtained a decree annulling all the acts and deeds of Richard of Cornwall and his predecessors, since the deposition of Frederick II, except such as had been approved by a majority of the electors. In consequence of this decree another was passed specifically in-validating the investiture of the Austrian provinces, which in 1262 was obtained from Richard of Cornwall by Ottocar.

Carinthia having been unjustly occupied by Ottocar, in contradiction to the rights of Philip, Archbishop of Salzburg, brother of Ulric, the last duke, the claims of Philip were acknowledged by Rudolph, and he took his seat at the Diet of Augsburg as Duke of Carinthia. On the conquest of that duchy he petitioned for the investiture, but Rudolph delayed complying with his request under various pretences, and, Philip dying without issue in 1279, the duchy escheated to the empire as a vacant fief.