The history of Hamburg begins with its foundation in the 9th century as a mission settlement to convert the Saxons. Since the Middle Ages Hamburg was an important trading center in Europe. The convenient location of the port and its independence as a city and state for centuries strengthened this position.
The city was member in the medieval Hanseatic trading league and a free imperial city of the Holy Roman Empire. From 1815 until 1866 Hamburg was an independent and sovereign state of the German Confederation, then the North German Confederation (1866–71), the German Empire (1871–1918) and during the period of the Weimar Republic (1918–33). In Nazi Germany Hamburg was a city-state and a Gau from 1934 until 1945. After the Second World War Hamburg was in the British Zone of Occupation and became a state in the western part of Germany in the Federal Republic of Germany (Since 1949).
The first term for the present city was following the reports of Claudius Ptolemy “Treva”. A fortress was named Hammaburg (where burg means fortress). The "Hamma" element remains uncertain. Old High German includes both a "hamma", "angle" and a "hamme", "pastureland". The angle might refer to a spit of land or to the curvature of a river. However, the language spoken might not have been Old High German, as Low Saxon was spoken there later. Other theories hold that the castle was named for the word of a surrounding vast forest, hammen.Hamm as a place name occurs a number of times in Germany, but its meaning is equally uncertain. It could be related to "heim" and Hamburg could have been placed in the territory of the ancient Chamavi. However, a derivation of "home city" is perhaps too direct, as the city was named after the castle. Another theory is that Hamburg comes from ham which is Old Saxon for “(grassy) river bank” or “meadow/pasture (by a river) ”.