Hamburg, officially Freie und Hansestadt 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. Its population is over 1.8 million people, and the Hamburg Metropolitan Region has more than 5 million inhabitants. The port of Hamburg, on the river Elbe, is the second largest port in Europe 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, 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.