The duchies of Austria and Styria were now claimed by the Dispute as to the Austrian succession. emperor Frederick II. as vacant fiefs of the Empire, and their government was entrusted to Otto II., duke of Bavaria. Frederick, however, who was in Italy, harassed and afflicted, could do little to assert the imperial authority, and his enemy, Pope Innocent IV., bestowed the two duchies upon Hermann VI., margrave of Baden, whose wife, Gertrude, was a niece of the last of the Babenbergs. Hermann was invested by the German king, William, count of Holland, but he was unable to establish his position, and law and order were quickly disappearing from the duchies. The deaths of Hermann and of the emperor in 1250, however, paved the way for a settlement. Weary of struggle and disorder, and despairing of any help from the central authority, the estates of Austria met at Trübensee in 1251, and chose Ottakar, son of Wenceslaus I., king of Bohemia, as their duke. Ottakar of Bohemia, duke. This step was favoured by the pope, and Ottakar, eagerly accepting the offer, strengthened his position by marrying Margaret, a sister of Duke Frederick II., and in return for his investiture promised his assistance to William of Holland. Styria appears at this time to have shared the fortunes of Austria, but it was claimed by Bela IV., king of Hungary, who conquered the land, and made a treaty with Ottakar in 1254 which confirmed him in its possession.
The Hungarian rule was soon resented by the Styrians, and Ottakar, who had become king of Bohemia in 1253, took advantage of this resentment, and interfered in the affairs of the duchy. A war with Hungary was the result, but on this occasion victory rested with Ottakar, and by a treaty made with Bela, in March 1261, he was recognized as duke of Styria. In 1269 Ottakar inherited the duchy of Carinthia on the death of Duke Ulrich III., and, his power having now become very great, he began to aspire to the German throne. He did something to improve the condition of the duchies by restoring order, introducing German colonists into the eastern districts, and seeking to benefit the inhabitants of the towns.
In 1273 Rudolph, count of Habsburg, became German king, Rudolph of Habsburg. and his attention soon turned to Ottakar, whose power menaced the occupant of the German throne. Finding some support in Austria, Rudolph questioned the title of the Bohemian king to the three duchies, and sought to recover the imperial lands which had been in the possession of the emperor Frederick II. Ottakar was summoned twice before the diet, the imperial court declared against him, and in July 1275 he was placed under the ban. War was the result, and in November 1276 Ottakar submitted to Rudolph, and renounced the duchies of Austria, Styria and Carinthia. For some time the three duchies were administered by Rudolph in his capacity as head of the Empire, of which they formed part. Not content with this tie, however, which was personal to himself alone, the king planned to make them hereditary possessions of his family, and to transfer the headquarters of the Habsburgs from the Rhine to the Danube. The Habsburgs established in Austria, 1282. Some opposition was offered to this scheme; but the perseverance of the king overcame all difficulties, and one of the most important events in European history took place on the 27th of December 1282, when Rudolph invested his sons, Rudolph and Albert, with the duchies of Austria and Styria. He retained Carinthia in his own hands until 1286, when, in return for valuable services, he bestowed it upon Meinhard IV., count of Tirol. The younger Rudolph took no part in the government of Austria and Styria, which was undertaken by Albert, until his election as German king in 1298. Albert appears to have been rather an arbitrary ruler.
In 1288 he suppressed a rising of the people of Vienna, and he made the fullest use of the ducal power in asserting his real or supposed rights. At this time the principle of primogeniture was unknown in the house of Habsburg, and for many years the duchies were ruled in common by two, or even three, members of the family. After Albert became German king, his two elder sons, Rudolph and Frederick, were successively associated with him in the government, and after his death in 1308, his four younger sons shared at one time or another in the administration of Austria and Styria. In 1314 Albert's son, Frederick, was chosen German king in opposition to Louis IV., duke of Upper Bavaria, afterwards the emperor Louis IV., and Austria was weakened by the efforts of the Habsburgs to sustain Frederick in his contest with Louis, and also by the struggle carried on between another brother, Leopold, and the Swiss. A series of deaths among the Habsburgs during the first half of the 14th century left Duke Albert II. and his four sons as the only representatives of the family. Albert ruled the duchies alone from 1344 to 1356, and after this date his sons began to take part in the government.
Duke Rudolph IV. The most noteworthy of these was Duke Rudolph IV., a son-in-law of the emperor Charles IV., who showed his interest in learning by founding the university of Vienna in 1365. Rudolph's chief aim was to make Austria into an independent state, and he forged a series of privileges the purport of which was to free the duchy from all its duties towards the Empire. A sharp contest with the emperor followed this proceeding, and the Austrian duke, annoyed that Austria was not raised to the dignity of an electorate by the Golden Bull of 1356, did not shrink from a contest with Charles. In 1361, however, he abandoned his pretensions, but claimed the title of archduke (q.v.) and in 1364 declared that the possessions of the Habsburgs were indivisible. Meanwhile the acquisition of neighbouring territories had been steadily pressed on. In 1335 the duchy of Carinthia, and a part of Carniola, were inherited by Dukes Albert II. and Otto, and in 1363 Rudolph IV. obtained the county of Tirol. In 1364 Carniola was made into an hereditary duchy; in 1374 part of Istria came under the rule of the Habsburgs; in 1382 Trieste submitted voluntarily to Austria, and at various times during the century, other smaller districts were added to the lands of the Habsburgs.