More than a century ago, fearing that his country might be swallowed up in the Great Game rivalry between the British empire to the east and the Russian army to the north, an Afghan king made a radical decision: He banned railroads.
That edict effectively kept out foreign troops for a number of years. But it also left the Afghan economy, once a wealthy crossroads of the ancient Silk Road trading routes, largely cut off from the world at a time when trains were the engines of development.
Now, Afghanistan has just opened its first major railroad and is planning a half dozen more. The government is also inviting other countries to build tracks, part of plans for a "New Silk Route" that the U.S. hopes will help stabilize the region by promoting trading links.
China, Iran, Pakistan and India all have government or corporate plans for separate railroad projects across Afghanistan. Turkmenistan is completing its own plans for another line. And Uzbekistan has already built the first major rail link, a 47-mile (75-kilometer) line from the border town of Hairatan to Mazar-i-Sharif in Afghanistan's north.
One reason so many countries are helping Afghanistan belatedly join the rail age: They need trains if their companies hope to export the country's vast, untapped mineral wealth, estimated by U.S. surveys at nearly $1 trillion.
Both the railway projects and the prospects for future mining wealth will depend largely on whether the country can keep violence from escalating once the international military force withdraws most of its troops by the end of 2014. For investors, it's a question of whether the increased commerce is worth the risk and effort.
"Now there is genuine trade and traffic going on, especially in the north of Afghanistan, so it makes sense," says Andrew Grantham, an editor for Railway Gazette who runs a website chronicling the history of Afghanistan's failed railroad projects. "It's not just people drawing lines on maps and saying, "Wouldn't this be nice?"
Competing for contracts to mine deposits of copper, gold, iron and lithium is Afghanistan's modern Great Game, and one of the prices the government is extracting from eager companies is a promise to develop the railroads necessary to carry the heavy cargo.
"This will be critical to get anything to markets," says Juan Miranda, head of Central and West Asia Department of the Asian Development Bank, which funded the $165 million Uzbek-built railroad. The bank is also pushing a plan to link landlocked Afghanistan into the rail networks of all five of its neighbors.
For now, plans for Afghanistan's railroads are progressing bit by bit. As part of its agreement to develop a massive copper mine in Aynak, the China Metallurgical Group Corporation (MCC) is being asked to build a 575-mile (920-kilometer) railway from the mine southeast of Kabul. One branch would head to the Pakistani border, another in the opposite direction through the capital and connecting with the new Hairatan line in the north.
The Afghan government is also negotiating with the Indian-led consortium that won the contract for the equally huge iron deposits at Tajigak in central Afghanistan for the companies to fund a 560-mile (900-kilometer) railroad - likely through Iran - to bring out the heavy ore.
The story of how Afghanistan never got a major railroad pivots around Abdur Rahman Khan, the emir who ruled Afghanistan from 1880 to 1901. During his reign, Afghanistan was sandwiched between the British colonial rulers of India, which then encompassed modern-day Pakistan, and the Russian empire that extended into Caucasus areas of Central Asia.
Both sides were engaged in what was known as the Great Game to control the region. They were racing to build railroads in areas under their control as a way of quickly moving troops. By the 1880s, both the British and the Russians had built tracks that went right up to Afghanistan's border.
Rahman Khan responded with a decree that no railroad would be allowed to enter Afghan territory, reasoning that without them, it would be difficult for invading troops to cross the mountainous frontier, according to Grantham.
Afghanistan is "almost unique worldwide" in its history of actively working to stop railroads, Grantham says. "Most countries wanted railways."
In fact, the emir's gambit may have worked: Afghanistan never was annexed by either great power.
"It is one of the factors that probably kept the country together, but the price was Afghanistan became a complete backwater economically," says Fred Starr, chairman of the Central Asia-Caucasus Institute at Johns Hopkins University in Washington.
In the 1920s, Rahman Khan's modern-minded grandson, King Amanullah, planned a modern rail network in Afghanistan and even built 5-mile (8-kilometer) track with steam locomotives running between Kabul and his European-style palace of Darulaman. But his plans for a wider network met with opposition, and the line fell into disrepair after he was overthrown in 1929. The locomotives are now in a Kabul museum, next to Amanullah's bombed-out palace.
Soviet occupiers abandoned a few rail projects in the 1980s, and later years of civil war made such construction impossible.
Now, the Afghan government, seeking to lift the country out of poverty, is trying to catch up to its neighbors by building links to Central Asia's fairly well-developed rail networks.
The plan is to build a series of short, cross-border tracks to Uzbekistan, Turkmenistan, Tajikistan, Pakistan and Iran. The tracks would connect to each other inside the country's north by railways built by Iran from the west and China from the east.
"We would be able to import and export to Russia, Turkey, and even European countries," says Noor Gul Mangal, Afghanistan's deputy public works minister. Opening new transport gateways would also reduce Afghanistan's dependance on neighboring Pakistan as its only link to sea ports.
Only one line is finished and several of the rest are delayed or face funding problems. But already, the prospect of restoring Afghanistan's status as the crossroads for goods traveling from India, China and Europe has kindled enthusiasm.
Instead of silk, spices and tea, the New Silk Route would carry washing machines from India, heavy machinery from Europe and T-shirts from Pakistan over interconnecting railroads that are faster than container ships and cheaper than air freight.
"Afghanistan is the key. It's the hub," Starr says.
It can all sound like a far-fetched dream for Afghanistan, with Taliban violence spiraling and international troops preparing to withdraw from the decade-long war. If President Hamid Karzai's government cannot prevent the country from plunging further into civil war, the mining companies may cut their losses. In which case more railroad projects will gather dust.