In February 2012, a part of the medieval city wall of Visby collapsed. The wall was constructed in several stages in the 13th and 14th centuries. It was decided that the collapsed part of the wall should be rebuilt. To determine a procedure for the rebuilding and to secure a safe work site, it was necessary to define the construction and structural behaviour of the wall. Furthermore, the cause of the collapse needed to be identified, in order to assess and predict the risk of future damage to other parts of the wall. An investigation into the construction of the wall was carried out through archival research and on-site examinations. Laser scanning made it possible to describe and study the geometry of the wall and the damage in detail, and a structural analysis was carried out. The results show that the wall was built in two stages, making its construction complicated. The structural analysis indicates that there is a concentration of forces to the outer masonry leaf of the lower part of the wall. The collapse was most likely triggered by freezing of the water contained in the masonry. The combination of high stress levels in the outer masonry leaf, due to the construction of the wall, with a loose core, thin outer masonry leaf and insufficient binding stones and weak adhesion in the bedding lime mortar in the lower part of the wall, resulted in a domino effect that explains the extent of the collapse. To secure the wall during dismantling, a temporary steel structure was constructed. The medieval types of construction and material in a two-leaf masonry wall have proven to be durable if correctly implemented, with sufficient binding stones and a core in order, and will therefore be used for the rebuilding.