The Holy Roman Empire and the Duchy of Austria

The gradual eastward extension of the Carolingian Empire was stopped
by the arrival of the Magyars--a Finno-Ugric people who form the ethnic
core of the Hungarian nation--in the Danubian region in 862. Within
fifty years, the Magyars had seized the Hungarian plain, conquered
Moravia and the eastern Danubian marches of the Carolingian Empire, and
raided deep into Frankish territory. A reorganization of the German
portion of the Carolingian Empire in the first half of the tenth century
enabled the Germans to rally their forces and defeat a Magyar invasion
force at the Battle of Lechfeld in 955. This new and essentially German
empire became known as the Holy Roman Empire and eventually regained
much of the territory lost to the Magyars. Nevertheless, the Magyars'
continuing military strength and their conversion to Christianity during
the reign of King Stephen (r. 997-1038) enabled Hungary to become a
legitimate member of Christian Europe and check German expansion to the
east.

Under the Holy Roman Empire, the territories that constitute modern
Austria were a complex feudal patchwork under the sway of numerous
secular and ecclesiastical lords. Most of the territories originally
fell within the boundaries of the Duchy of Bavaria. Over the years,
various territories were effectively detached from Bavaria, either
becoming part of the newly established duchies of Carinthia (976) and
Styria (1180) or, like Salzburg and Tirol, falling under the
jurisdiction of powerful bishops. In the final years of the reign of
Emperor Otto the Great (r. 936-73), a small margravate roughly
corresponding to the present-day province of Lower Austria was formed
within Bavaria. This margravate became known as Ostarrichi (literally,
Eastern Realm), from which the modern name Austria (Österreich)
ultimately derives. The Margravate of Austria was detached from Bavaria
and became a separate duchy in 1156.

Between 976 and 1246, the Duchy of Austria was one of extensive
feudal possessions of the Babenberg family. Through their ties of blood
and marriage to two successive German imperial dynasties, the Babenbergs
gradually acquired lands roughly corresponding to the modern provinces
of Upper Austria, Lower Austria, Styria, and Carinthia. When the
Babenberg line died out in 1246, their lands passed to the ambitious
king of Bohemia, Otakar II. As king of Bohemia, Otakar was one of the
small circle of "elector-princes" who were entitled to
participate in the election of the Holy Roman Emperor. When Otakar
failed to be elected emperor in 1273, he contested the election of the
new emperor, Rudolf von Habsburg. The Bohemian king met his defeat and
death in battle in 1278, and the former Babenberg lands passed to the
Habsburgs, who added them to their already extensive lands in
present-day Switzerland, southwestern Germany, and eastern France.