Founded as Oreshek in 1323 by the republic of Novgorod, the town was captured in the early 17th century by the Swedes, who built the fortress of Noteburg. Taken by Peter I the Great in 1702, it was renamed Shlisselburg and became a key fortress protecting St. Petersburg. Later used as a prison, Shlisselburg again played a fortress role during the defence of Leningrad (as St. Petersburg was called during the Soviet era) in World War II. Between 1944 and 1991 the town was called Petrokrepost ("Peter's Fortress").