Located in the boundary zone between the East Slavic/Russian and Finnish worlds, the town has changed hands several times in history, most recently in 1944 when the Soviet Union captured it from Finland during World War II.
The city hosts the Russian end of the 1,222 km (759 mi) Nord Stream gas pipeline, laid in 2011 and operated by a consortium led by Russia's Gazprom state hydrocarbons enterprise to pump 55 billion cubic meters (1.9 trillion cubic feet) of natural gas a year under the Baltic to Greifswald, Germany.
The area where Vyborg is located used to be a trading center on the Vuoksi River's western branch, which has dried up. The region was inhabited by the Karelians, a Balto-Finnic tribe which gradually came under the domination of Novgorod and Sweden. According to archeological digs and research, on the site of Vyborg there were a Karelian trading post in the 10th century and it belonged to the same Finnish cultural area with western Finland from Viking Age onwards. It`s been claimed that Vyborg appeared in the 11th–12th centuries as a mixed Karelian-Russian settlement, although there isn't archeological proof of any East Slavic settlement of that time in the area and it isn't mentioned in any earliest historical documents, such as Novgorod First Chronicle or Primary Chronicle. Settlement in the area of Vyborg is generally regarded to date from 13th century onwards when Hanseatic traders started to travel to Novgorod.
The Viborg Castle was founded during the so-called "Third Swedish Crusade" in 1293 by marsk Torkel Knutsson on the site of older Karelian fort which was burned. The castle was fought over for decades between Sweden and the Novgorod Republic. By the Treaty of Nöteborg in 1323 between the Republic of Novgorod and Sweden, Vyborg was finally recognized as a part of Sweden. The town's trade privileges were chartered by the Pan-Scandinavian King Eric of Pomerania in 1403. It withstood a prolonged siege by Daniil Shchenya during the Russo–Swedish War of 1496–1497.