The development of Latvia is characterized as a history of occupation. The country managed to survive two world wars and 50 years behind the Iron Curtain. In the 13th century German knights founded a state on the territory of modern Latvia. From the 16th to the 17th century, Latvia was ruled by a Polish-Lithuanian princedom and by Sweden. Then it got under the rule of the Russian Empire. The foundation of an independent Latvian state was a result of a rising Latvian nationalism and the Russian revolution. The period of independence lasted from 1920 to 1940, till the invasion of the USSR. Latvian Republic could restore its independence after the collapse of the Soviet Union in August of 1991.