From the early days, Afghanistan has been a tempting vision for railway planners, having at one time been seen as a potential overland route between Europe and India via Russia, avoiding the long sea journey. Termez in Uzbekistan is just a tantalizing 400km (250 miles) from Landi Kotal in Pakistan, near the Khyber Pass. Both these places were rail served by the early part of the 20th century, and as a bonus the proposed line would pass through the Afghan capital of city Kabul. Some major engineering work would be required, including a long tunnel under the Hindu Kush, but nothing that was beyond the technology of the time.
But the political situation in Afghanistan during the 19th century and the first decades of the 20th century was volatile, to say the least. There was internal unrest and several periods of open warfare with neighbouring British India. By the 1920s, Afghanistan was a somewhat more stable country, but Russia was now under a communist government that was unlikely to be sympathetic to commercial through traffic between what it saw as imperialist countries.
During this period, the Afghan rulers did commission some work to be done on a proposed railway system for internal communications. A German firm was contracted to do various surveys and preliminary work. However, the only railway that was actually built in this period was a 7km, steam hauled, roadside tramway that operated for a few years between Kabul and Darulaman. The locomotives are reported to be still in existence, though in poor condition, at the Kabul museum.
In the 1950s a small narrow-gauge industrial railway was installed at a power station, but apart from that there was no further railway construction until the period of Soviet occupation.
The Soviet Union built two rail lines in the 1980s, using the Russian standard gauge of 1520mm, to connect their own system with Afghanistan. Both lines crossed the Amu Darya river into Afghanistan itself, but were never extended further. Both lines fell out of use with the Soviet withdrawal. The Friendship Bridge at Hairatan was reopened in 2001, and that at Towraghondi in 2007.
Until recently, the Afghan railway system thus consisted of just 0.8 route km of 1520mm gauge track at these two railheads, operated by Uzbekistan Railways at Hairatan and Turkmen Railways at Towraghondi. An extension of the line from the Hairatan railhead to Naiabad, near the city of Mazar-i-Sharif, a distance of about 75km, opened for commercial service in 2012. It is operated by Uzbekistan Railways under contract to the Afghan government.
In 2016, a new link with Turkmen Railways was established with a border crossing at Immamnazar. The line extends to Akina, about 3km inside Afghanistan.
A standard (1435mm) gauge line from Mashhad, Iran to Herat, about 125km of which will be in Afghanistan, is under construction. Further lines are proposed.
Flag image from CIA World Factbook