The earliest history of Visby is uncertain, but it is known to have been a centre of merchandise around AD 900. It was inhabited as early as the
Stone Age, probably because of the access to fresh water and a
natural harbour. The oldest finds at the site of present-day Visby are what have been interpreted as "beach huts", with the
radiocarbon dating method to the 7th–9th centuries AD. In the 12th century,
Visby Cathedral, dedicated to
Saint Mary, was constructed. It was reshaped in the 13th century to its current appearance, and was officially opened in 1225, by the bishop of the Swedish city of
Linköping (
in regional map). Several other churches were also constructed in the ensuing centuries. The city flourished, thanks to the German
Hanseatic League. '', by
Carl Gustaf Hellqvist (1851–1890). The work on the
ring wall was likely begun in the 12th century. Around 1300, it was rebuilt to reach its current height, acquiring the characteristic towers, although some towers were not constructed until the 15th century. The
ringwall is still largely intact. In the first half of the 14th century (1300–1350), Visby was at the height of its wealth and influence, and it was during this time that
Laws of Wisbuy, a set of maritime laws that had broad influence in the Baltic and beyond, were probably promulgated. In 1361,
Gotland was conquered by
Valdemar IV of Denmark. 1,800 Gotlanders were killed in battle in front of the city. Valdemar added "King of Gotland" to his title list. His treatment of Visby, a member of the Hanseatic League, precipitated that League into war with Denmark; however, though Valdemar was forced into various concessions, he retained Visby as a Danish city. In 1391, 1394 and 1398, it was taken and plundered by the
Victual Brothers, pirates who sailed the
Baltic Sea. An invading army of
Teutonic Knights conquered Gotland in 1398, destroyed Visby and expelled the Victual Brothers. Gotland was again taken into Sweden's possession in 1645, by the
Treaty of Brömsebro, after 300 years of Danish rule. In the mid 18th century,
after a plague had reduced Visby's population, some attempts were made by Swedish government officials to improve living standards, but little was accomplished. Not until the early 19th century did Visby once again attract commerce and a harbour industry. At the same time – 1808 –
Gotland was conquered by Russia, but was peacefully taken back by the Swedes after only a couple of months. == Geography ==