The ports and human capital of Liepāja and Ventspils were targets of Joseph Stalin. He signed the Molotov–Ribbentrop pact in part to gain control of this territory. When the Soviet Union occupied and annexed Latvia in 1940, it nationalized private property. Many thousands of former owners were arrested and deported to the gulag camps in Siberia.