The March of Styria (German: Steiermark), originally known as Carantanian march (Karantanische Mark, marchia Carantana after the former Slavic principality of Carantania), was a southeastern frontier march of the Holy Roman Empire. It was broken off the larger March of Carinthia, itself a march of the Duchy of Bavaria, around 970 as a buffer zone against the Hungarian invasions. Under the overlordship of the Carinthian dukes from 976 onwards, the territory evolved to be called Styria, so named for the town of Steyr, then the residence of the Otakar margraves. It became an Imperial State in its own right, when the Otakars were elevated to Dukes of Styria in 1180.
After the Slavic settlement of the Eastern Alps from about 590 and the establishment of the Carantanian principality in the 7th century, the area had fallen under Bavarian suzerainty, when about 740 Prince Boruth asked Duke Odilo for help against invading Avar forces. Incorporated into the Carolingian Empire by Charlemagne, Frankish manoralism was introduced and the northwestern areas were resettled by Bavarian peasants. The population was Christianized by the Archbishops of Salzburg. However, large parts of former Carantania were again lost during the invasion of Hungarian troops culminating in the East Frankish defeat in the 907 Battle of Pressburg.
King Otto I of Germany ended the Hungarian invasions in the 955 Battle of Lechfeld. In the aftermath, the former Carantanian lands were reconquered up to the Lafnitz River in the east. When in 976 King Otto II separated the Duchy of Carinthia from the Bavarian stem duchy, it included the marches of Verona, Istria, Carniola, and the marchia Carantana (Styria), comprising the adjacent eastern territory beyond the Koralpe range on to the Mur, Mürz and Enns rivers. In 1042/43 further territory east of the Mur up to Pitten and the Leitha river was conquered by King Henry III of Germany, who finally defeated the Hungarian forces in the 1044 Battle of Ménfő.
The Carantanian lands were largely settled by Germans and Christianized by the Archbishops of Salzburg. In 1004, the Bavarian count palatines of the Aribonid dynasty founded the Benedictine nunnery of Göss, which was elevated to an Imperial abbey by Emperor Henry II in 1020. Archbishop Gebhard of Salzburg established Admont Abbey in 1074, and St. Lambrecht's Abbey was founded as a proprietary monastery of the noble House of Eppenstein two years later. Further cloister foundations included the Cistercian abbey of Rein in 1129, Seckau Abbey in 1140, Spital am Semmering in 1160, the Augustinian monastery of Vorau in 1163, and the charterhouse of Seitz (Žiče) in 1164.
The first margraves from the House of Eppenstein appear in the late 10th century. Margrave Adalbero was also enfeoffed with the Duchy of Carinthia in 1011/12, but was deposed for alleged high treason by Emperor Conrad II in 1035. In 1053/54, the margravial lands were pillaged by the forces of the deposed Bavarian duke Conrad I and Duke Welf of Carinthia. From 1056 onwards, the march was ruled by the Chiemgau count Ottokar I and his descendants of the Otakar dynasty, who were first mentioned as "Margraves of Steyr" in 1074. In 1122, they also inherited the allodial possessions of their Eppenstein predecessors in Upper Styria.
Once the political turmoils of the fierce Investiture Controversy had ended, Margrave Leopold the Strong (1122–1129) and his son Ottokar III (1129–1164) gradually gained independence from the Carinthian dukes and were able to acquire large territories along the Savinja river down to the Windic March. Leopold had the town and castle of Hartberg laid out. Margrave Ottokar III extended his influence down the Mur river into the Mark an der Sann territory (Lower Styria) and moved his residence to Graz; he already began to call himself princeps. In 1180, his son and successor Margrave Ottokar IV was finally elevated to the rank of Duke of Styria by Emperor Frederick Barbarossa.
However, Ottokar IV was also the last Otakar duke. The line became extinct upon his death in 1192, whereafter the Styrian lands were inherited by the Babenberg dukes of Austria according to the 1186 Georgenberg Pact.