State in the eastern Baltic region, created in 1918 out of the former Russian provinces of Courland (an autonomous duchy linked to Poland until 1795), Livonia (under Swedish rule from 1629 to 1721), and Latgalia (part of the Polish–Lithuanian Commonwealth until 1772). Between 1940 and 1991, Latvia was a republic of the Soviet Union, regaining full independence with the breakup of the USSR.