Fief of Viborg or Margraviate of Wiburg 1320–1534, was for some two centuries a late medieval feudal fief in the southeastern border of Finland and the entire Swedish realm, held by its chatelain, a fiefed, appointed feudal lord.
For extended periods the medieval commanders of Viborg castle (chatelains, castellans), on the border with republic of Novgorod, did in practice function as margraves, collecting the crown's incomes from the fief in their own name and being entitled to keep them all to use for the defense of the realm's eastern border. They enjoyed more independence than the kingdom's other castellans, "burgraves". However the fief of Viborg castle and its county, was not formally hereditary, though almost all appointees were from certain families, related to the Bonde-Bååt-Haak family that also between the 1350s and 1390s held the Swedish titular version of the earldom of Orkney.
Organization of that new territory for the Swedish realm took place between the 1290s and 1330s. The conquered Kexholm was lost, and Neva river's Landskrona was destroyed catastrophically. There was much sporadic warring for decades after, until 1323. Viborg was however held, and the coast westwards. When the conquest became established, a special fief became formed. Gotland had strong trade relations with coastal Carelia. Novgorod succeeded maintaining its control of the Ladoga coast and Neva river.
The independence and privileges of the county were founded by the Joninpoika brothers. Squire Peter Jonsson (later knighted) and his elder brother sir Sune Jonsson, Lord of Flishult, Royal Councillor, the lawspeaker of Tiohärad (in inland Småland), together with their close relative Charles, bishop of Linköping, allies of the new king Magnus IV of Sweden, in 1320 or 1321 purchased dominus Efflerus, the bailiff of the deposed king Birger of Sweden, out from Viborg castle. They committed to keep the castle and its revenues for bishop Charles until the purchase price be compensated.