Charlemagne at first attached the Istrian peninsula to the Lombard Duchy of Friuli, part of the Carolingian Kingdom of Italy under his son Pepin. Though officially a duchy, Friuli de facto was a march with a merely titular ducal dignity, from 776 ruled by Frankish appointees.
An Istrian margraviate itself first emerged following the death of Duke Eric of Friuli in the 799 Siege of Trsat on the Frankish border with Littoral Croatia. Istria was enfeoffed to the Frankish count Hunfrid, who also bore the title of a dux Foroiulanus. The original Carolingian march stretched from the Julian Alps and the Karst Plateau down to the Gulf of Kvarner. It was one of three marches, along with Friuli and Carantania, guarding Italy from the Avars, Slavs, and Magyars successively. In the first decade of the 9th century, Istria was ruled by one Duke John, nominally according to its ancient Byzantine customs, but in fact as a Frankish vassal. The region then had nine cities, Trieste foremost among them.
After King Pepin had made several attempts to conquer Venice on the Adriatic coast, his father Emperor Charlemagne under the 812 Treaty of Aix-la-Chapelle finally recognised the formal Byzantine control over the city along with Istria, at least its western coast. After this, it falls into obscurity, but perhaps the Byzantines never succeeded in re-establishing their government in the returned territories, if they were actually handed over. The remaining parts of Istria were probably eventually just re-integrated into the Carolingian duchy of Friuli.
After the German king Otto I had campaigned northern Italy under Berengar's grandson King Berengar II, in 952 he merged Friuli into the vast March of Verona, which he granted to his brother Duke Henry I of Bavaria, who already controlled the adjacent Carinthian and Carniolan marches. After the deposition of Henry's son and successor Duke Henry the Wrangler in 976, Emperor Otto II separated Carinthia from the Bavaria as a duchy in its own right, ruled by Duke Henry the Younger who was also given suzerainty over the southeastern Bavarian marches, including Verona, Istria, Carniola and Styria.
There appear counts of Istria late in the 10th century, but Istria together with the March of Carniola was separated from the Carinthian duchy in 1040, when both were bestowed on the Thuringian Count Poppo of Weimar, heir by marriage to the last known Friulian margrave Weriand (Werigand (Friaul)). The Carniolan margraves gradually acquired the northeastern territories of the peninsula, while the western and southern coast was gradually occupied by the Republic of Venice. The German king Henry IV nominally assigned the remaining march to the Patriarchate of Aquileia, the margravial title and the Istrian territories were however retained by Carniola. In 1173 the Hohenstaufen Emperor Frederick Barbarossa enfeoffed the Bavarian noble House of Andechs, who attached Istria to their Duchy of Merania. Aquileia regained Istria in 1209, when the Andechs margraves were banned due to alleged entanglement in the assassination of the German king, Frederick Barbarossa's son Philip of Swabia.
By mid-century most of the Istrian coast had been conquered by Venice. The patriarchs had ceased appointing margraves and had given the remaining interior of the peninsula into the direct control of their Vogt officials, the Counts of Görz. The Görz territories were finally acquired by the Habsburg archdukes of Austria in 1374, who since 1335 had held the Carniolan march. In 1382 they also gained control over the City of Trieste.
Habsburg Margraviate
After the secular territory of the patriarchs of Aquileia had been completely conquered by Venice in 1420, most of Istria belonged to La Serenissima. The Austrian House of Habsburg only held a small territory in the interior of the peninsula around Pazin (Mitterburg), which it administered from its Carniolan duchy. The Habsburg rulers nevertheless added the title of a "Margrave of Istria" to their other titles, persisting until the dissolution of the Austro-Hungarian monarchy in 1918.
After the partition of the Illyrian kingdom in 1849, the Margravate of Istria became a subdivision of the Austrian Littoralcrown land. It received considerable autonomy as a crown land in its own right with the establishment of the Diet of Istria at Parenzo by the 1861 February Patent.