Hamburg, officially Freie und Hansestadt Hamburg (Free and Hanseatic City of Hamburg), is the second largest city in Germany and the eighth largest city in the European Union. It is also the thirteenth largest German state. It is home to over 1.8 million people, while the Hamburg Metropolitan Region (including parts of the neighbouring Federal States of Lower Saxony and Schleswig-Holstein) has more than 5 million inhabitants. On the river Elbe, the port of Hamburg is the second largest port in Europe (after the Port of Rotterdam) and tenth largest worldwide.
The official name reflects its history as a member of the medieval Hanseatic League, as a free imperial city of the Holy Roman Empire, and that it is a city-state, and one of the 16 states of Germany. Before the 1871 Unification of Germany, it was a fully sovereign state. Prior to the constitutional changes in 1919, the stringent civic republic was ruled by a class of hereditary grand burghers or Hanseaten.