In September 1939, the Soviet Union invaded Poland and occupied Galician lands inhabited by Ukrainians, Poles and Jews adding it to the territory of the Ukrainian SSR. In 1940, the Soviet Union occupied Bessarabia, Northern Bukovina and Hertza, lands inhabited by Romanians (Moldovans), Ukrainians, Russians, Jews, Bulgarians and Gagauz, adding them to the territory of the Ukrainian SSR and the newly formed Moldavian SSR. In 1945, these lands were permanently annexed, and the Transcarpathia region was added as well, by treaty with the post-war administration of Czechoslovakia. Following eastward Soviet retreat in 1941, Ufa became the wartime seat of the Soviet Ukrainian government.