In 1869 the Russians established the port of Krasnovodsk (now Turkmenbashi) and began their penetration into the area that is now Turkmenistan. Kizyl Arvat was taken in 1873, and the Turkmenian stronghold at Geok Tepe (near Ashgabat) fell in 1881, breaking the Turkmenian resistance and consolidating Russian control. After the 1917 revolution, the Bolsheviks were in power for a short time until overthrown by White Russians in 1918. Two years later the Bolsheviks regained control, and in 1924 the Turkmen Soviet Socialist Republic was founded. It became a union republic in 1925. During 1990–91, rising nationalism throughout the union republics gradually eroded the authority of the Soviet central government. In 1991, after the Soviet Union collapsed. Turkmenistan became independent. Also that year, Turkmenistan joined the Commonwealth of Independent States, a loose confederation of former Soviet republics.

Following Turkmenistan's independence, Saparmurad A. Niyazov became president. In 1994, his term was extended to 2002 and, then in 1999, indefinitely. However, he died in December, 2006. Deputy Prime Minister Gurbanguly Berdimuhammedov became acting president. In February, 2007, Berdimuhammedov was elected president.