Construction was begun in 1879 as a narrow-gauge railway to Kyzyl-Arvat in connection with the Russian conquest of Transcaspia under General Mikhail Skobelev. It was rapidly altered to the standard Russian gauge of five feet, and construction through to Ashkabad and Merv (modern Mary) was completed under General Michael Nicolaivitch Annenkoff in 1886. Originally the line began from Uzun-Ada on the Caspian Sea, but the terminus was later shifted north to the harbour at Krasnovodsk. The Railway reached Samarkand via Bukhara in 1888, where it halted for ten years until extended to Tashkent and Andijan in 1898. The permanent bridge over the Oxus (Amu-Darya) was not completed until 1901, and until then trains ran over a rickety wooden construction that was often damaged by floods. As early as 1905, there was a train ferry across the Caspian Sea from Krasnovodsk to Baku in Azerbaijan. The Tashkent Railway connecting the Transcaspian Military Railway with the network of other Russian and European railways was completed in 1906.
It continues through Bukhara (where a branch line built in 1910 leads to Termez and Dushanbe) and then carries on to Samarkand. At Sirdaryo, where it crosses the Syr Darya river, a branch runs east into the fertile Fergana Valley. From there the railway continues to Tashkent. There another northwest bound line runs to Kazakhstan, which branches at Arys forming the Turkestan-Siberia Railway to Novosibirsk.