The treaty came at an unstable period in Russian history known as the Time of Troubles, where the death of Tsar Feodor I in 1598 led to decades of civil war.
In 1605, following the death of de facto ruler Boris Godunov, Vasily Shuisky came to power, triggering a conflict with a pretender to the Russian throne, False Dmitry II.
The terms of the Treaty of Viborg stipulated that Sweden would supply a corps of mercenaries to Shuisky to fight False Dmitry II and the Poles in exchange for Swedish control of the nearby strategic Korela Fortress, as well as its town Kexholm and the respective county.
[3] Around this time, Nyen's governor, John Geselia the Younger, banned Orthodox Christian Swedish subjects from settling in or near the town following tensions with Lutherans.
By the end of the 17th century, Nyenskans entered its final form after it had been modernized by an extensive project led by engineer Heinrich von Soylenberg.
Schlötburg stood in contrast to Shlisselburg ("Key-town"), the new name for Nöteborg at the other end of the Neva River, which Peter believed was the "Key to Ingria".
In 1703, Peter decided to found Saint Petersburg, a brand new capital city for the Tsardom of Russia, from scratch in the Neva River delta on the land around Nyenskans.
Peter had disliked Moscow, Russia's largest city and historical capital, which he considered inconveniently located and too isolated from the rest of Europe.
He also had an interest in seafaring and maritime affairs, believing Russia needed a new port city to replace Arkhangelsk, which he similarly considered to be inconveniently located.
Other documents and maps suggest Nyenskans was gradually demolished over the following decades as Saint Petersburg expanded onto the land in the direct vicinity of the fort.
In early 2007, the remains of Nyenskans' bastions were identified during archaeological excavations, which were necessitated by the threat of irrecoverable exploitation of the entire site to development from the territory of demolished shipyard Petrozavod to the grounds for planned skyscraper headquarters of the Moscow-based national natural gas monopoly Gazprom, Okhta Center, that would dwarf the beautiful cityscape.
This caused protests from the city conservation activists, but they defended the location only after archeologists found remains of the star fort and preceding structures.