It does not matter how slowly you go so long as you do not stop.
The earliest history of Visby is uncertain, but it is known to have been a centre of merchandise around 900 AD. It was inhabited as early as the stone age, probably because of the access to fresh water and a natural harbour.
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. Several other churches were also constructed in the ensuing centuries. The city flourished, thanks to the German Hanseatic League.
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 1361, Gotland was conquered by Valdemar IV of Denmark and Visby became a Danish city. Important as it was, some setbacks occurred. In 1391, 1394 and 1398 it was taken and plundered by the Victual Brothers, pirates who sailed the Baltic Sea. In 1411, King Eric of Pomerania had the castle of Visborg constructed, and settled himself there for twelve years, during which the city virtually became a pirates nest, and the commerce halted. As of 1470, the Hanseatic League rescinded Visby's status as a Hanseatic town.
In 1525, the final blow came. The merchants of Visby were in a feud with Lübeck in what is now Germany. The Lübeckers burned down all Visby's churches except the cathedral. The ruins have been preserved until this day, adding their gravity to the modern city.
Gotland was again conquered by Sweden in 1645 at the Treaty of Brömsebro, after 300 years of Danish rule. The city developed slowly as things were left as they were. In the mid 18th century 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.