Tajikistan was not an immediate convert to communism. After the 1917 Bolshevik revolution, White Russians had fled south, the indigenous basmachi movement (see box, The BasmachU below) fought a determined war of resistance, and a short-lived independent state was formed by young, Jadid-influenced nationalists in Kokand.
In the early years of Soviet control, it was uncertain where Tajikistan would lie. It was first of all part of the Turkestan Soviet Socialist Republic (1918-24), then an autonomous satellite to the Uzbek SSR (1924-29), and only in 1929 was the Tajik state upgraded to an SSR in its own right. Although Stalin theoretically divided central Asia on ethnic-linguistic lines, the Tajik SSR was a grotesquely deformed beast, with the Tajik-majority cities of Bukhara and Samarkand given to Uzbekistan, the Uzbek city of Khujand appended to Tajikistan, and the Tajik exclave of Vorukh entirely surrounded by Kyrgyzstans sovereign territory.
Soviet rule was a mixed bag for Tajikistan. On the one hand the country developed rapidly, agriculture was dragged more or less into the 20th century, and living standards improved. Tajikistan industrialised, the population became literate, and for the first time Tajik women entered the workplace. The country became economically, culturally and linguistically linked to a global superpower. The downsides were political repression and purges, forced collectivisation leading to famine, and environmental damage, the consequences of which are still being felt.