Visborg (Wisborg) refers to a fortress in the town of Visby on the Swedish island of Gotland. Successive fortresses were built in Visby (borg means fortress or castle), though Visborg is usually in reference to the castle built here by King Eric of Denmark, Norway and Sweden.
Duke Eric (son of King Magnus III of Sweden) appears to be the first to construct a fortress in the southwest corner of Visby in 1310 as part of a struggle between his brothers for control over the kingdoms of Sweden and Norway as well as Danish claims on Gotland; this brings Gotland under Norwegian control. When King Magnus IV, son of Duke Eric, becomes King of Norway and Sweden it falls under his control. In 1356 King Magnus gives control of Norway to his son, King Haakon VI Magnusson, though Magnus still remains as King of Sweden.
In July 1361 Danish forces, under King Valdemar Atterdag, land in Gotland and crush and seize Visby on 27 July, killing at least 2000 peasants.
The following year, 1362, Swedish Nobles revolt and declare Haakon King of Sweden.
The following year is defining for the future of Scandinavia. In 1363 Haakon and Magnus reconcile and Haakon marries Margaret (Queen Margaret I of Denmark), the daughter of Valdemar; father and son agree to share the throne of Sweden. The nobles again rise up and offer the crown to Magnus's nephew Duke Albert of Mecklenburg.
In 1375 King Valdemar of Denmark dies and Margaret ensures that her and Haakon's infant son, Olaf (Olav) is named heir to the throne. Only five years later, in 1380 her husband Haakon, King of Norway, dies making Olaf heir apparent to both thrones of Norway and Denmark upon his becoming of age; until that time his mother acts as Queen Regent to both nations. However, in 1387 Olaf dies, and Margaret becomes ruler of Denmark and Norway.