The city was founded around 800 as a defensive node, and from the 12th century onwards grew in a planned and systematic manner, merging with the smaller market townships in the area. In the 13th century it became part of the Hanseatic League (an association of trading towns), and soon became a leading commercial centre.
Comenius first stopped in Hamburg in 1642, when he was returning from England, and then again in 1656 after the razing of Leszno, while working out where his family could seek refuge. In 1642 he sought assistants for his work on pansophy here – in which he was successful, receiving the co-operation of Joachim Jung (Joachim Jungius, 1587-1657), who ran a Latin school, and the mathematician Adolf Tass (Adolf Tassius, 1585-1654). In 1656 he waited here some six weeks until his health was recovered, and he was able to continue on to Amsterdam. He had copies made of the Panaugia and Panegersia in order that they be ready for printing. He also wrote a report of the destruction of Leszno (Lesnae excidium), which he had just survived.