Liepaja is a city in western Latvia on the Baltic sea. It is the third-largest city of Latvia and an important ice-free port. Liepaja was founded by Curonian fishermen and was first known by the name Lyva in 1253. The Livonian Order under the aegis of the Teutonic Order established the settlement as the town of Libau in 1263. The name Liepaja began to increase in usage after 1560. In 1625 Duke Friedrich Kettler of Courland granted the town city rights, which were affirmed by King Sigismund III of Poland in 1626.
Liepaja and Courland passed to the control of Imperial Russia in 1795 during the Partitions of Poland. The city became a major port on the Baltic Sea for the Russians, and was a central point of embarcation for immigrants travelling to the United States. For a brief time in 1919 when most Latvian territory was occupied by Bolsheviks, Liepaja was a provisional seat of government for the country.