On July 25, the railway was one of 33 new sites awarded World Heritage status by the United Nations Educational Scientific and Cultural Organization (UNESCO), joining world famous locations such as Venice, Machu Picchu in Peru, Yellowstone National Park in the US and Ecuador's Galapagos Islands.
Linking the Persian Gulf with the Caspian Sea, the strategically important project was a relative latecomer in railway terms. It opened in 1938 after 11 years of hugely challenging construction.
Although not widely known outside Iran today, it can legitimately claim to be one of the greatest engineering feats of the 20th century.
The railway -- which carries both freight and passenger trains -- runs roughly north-east from Bandar-e Eman Khomeyni (formerly Bandar Shahpur) via Ahvaz, Qom and Tehran to Bandar Torkaman (previously Bandar Shah).
No fewer than 224 tunnels total more than 76 kilometers in length, while 174 viaducts and 186 smaller bridges carry the railway across deep ravines and river valleys as it climbs to two 2,134-meter (7,000-foot) summits.
Negotiating two formidable mountain ranges required not just steep gradients, but ingenious civil engineering to gain height via spiral tunnels and giant leaps over isolated valleys in fiercely hot, rugged terrain unsuited to railway building.
Countless geological and engineering challenges had to be overcome to complete the line. Some tunnels had to be abandoned during construction after salt and gypsum deposits were found, forcing new routes to be located, while another tunnel through volcanic pumice could be neither blasted nor dug out with picks and shovels.
Another tunnel encountered a cavernous void under the mountains, a problem solved by building a bridge inside the tunnel.
Day-to-day problems included a lack of fresh water for mixing good quality mortar and concrete and keeping workers and train crews hydrated.
Lengthy gradients take the single-track railway high into the mountains on either side of Tehran, which itself sits on a high plateau.
Highlights for those able to experience it include the Se Khat Tala (Three Golden Lines) spiral, where the line can be seen at three different heights thanks to loops and tunnels that help it to gain height, and the spectacular Veresk Bridge in the Alborz mountains.
Built in 1934/35 by an Italian contractor, the latter soars 110 meters above the valley floor on a 66-meter masonry arch.
Local folklore claims that to assuage fears that the slender structure would not be able to handle the weight of the trains, its Italian chief engineer and his family were instructed to stand underneath for the passage of the first train.
Tim Littler is the founder of UK-based Golden Eagle Luxury Trains, which ran 19 tours to Iran between 2014 and 2019. The company included a journey on the Trans-Iranian line on its 'Heart of Persia' trip from Tehran.
"Immediately after leaving Pol-e-Safid (at the northern end of the route) the line starts climbing on a ruling gradient of 1-in-35 for around 65 miles, limiting speeds to just 20 mph (32 kph)," says Littler.
"During this section the train passes over the famous Veresk Bridge and several loops and horseshoe curves where the line doubles back on itself inside a tunnel, emerging higher up the mountain."
There are more attractions on the line south-west of Tehran, as it continues through Qom and climbs through the nuclear center of Arak to the summit at Noor Abad, he adds.
"From this spectacular 220-mile section through Doround and Andimeshk it's possible to visit the ancient city of Susa, dating back to 4,200BC, and two other World Heritage sites -- the ancient hydraulic water system of Shustar and the Elamite complex at Chogha Zanbil, abandoned as long ago as 640BC," he says.
The Trans-Iranian line was the first part of an ambitious network planned by the-then leader of the country, Reza Shah-Pahlevi, as he strove to modernize Iran's communications and economy in the 1930s.
Other lines were planned or built to link Tehran to the Soviet Union, Turkey and Pakistan (which was then British India).
However, construction of the costly north-south railway, estimated at around $39 million at the time of completion (more than $2.7 billion in today's figures), weighed heavily on the developing nation, making it widely unpopular and eventually contributing to the Shah's downfall.
Early proposals for a railway across Iran linking the Russian Empire and British India were mooted in the late-19th and early 20th centuries, but diplomatic concerns about the balance of power in the region, Britain's indifference and Russia's war with Japan in 1905 focused attention and finite funds elsewhere.
Eventually, the German-backed Baghdad Railway, linking Europe with the Middle East via the Ottoman Empire, threatened to increase Berlin's influence in the region by building an extension to Tehran.
Russia and Britain were forced into action, but in 1914, with surveying and preparation work underway, World War I intervened.
Five years later, the world had changed. Germany had been subdued, Russia was under new management and Iran was technically independent, albeit weak and virtually bankrupt.
Despite this, the Trans-Iranian Railway was seen as a vital tool for modernizing the country and overcoming poor communications across a sparsely settled region.
When it finally got underway, construction of the railway was a remarkable collaborative effort by 43 contractors from many countries, including the US, UK, Germany and Denmark.
Unusually for a major Asian railway of the time, it was funded entirely by Iran itself. It was heralded as a symbol of the independent country's modernization and growing national confidence but financing the project from taxes on commodities such as sugar and tea was also a buttress against foreign exploitation, especially by the British Empire and Soviet Union.
An international syndicate, the Syndicat du Chemin du Fer en Perse, undertook the construction of the initial test lines with an American team starting from the south and a German consortium working from the Caspian Sea coast to the foothills of the Alborz mountains at Shahi.
Delays to payments led to the Americans pulling out in 1930 and it took three years to find a replacement in the form of Danish construction company Kampsax. The Danes sub-contracted the project in 43 lots to companies from Europe, the US and Iran. Overseeing this diverse workforce, Kampsax managed to complete the line by August 1938 -- under-budget and almost a year ahead of schedule.
To power trains over the demanding route, Beyer, Peacock & Co. of Manchester in England supplied four huge, articulated Garratt steam locomotives. These 14-axle behemoths were similar to machines built for British colonial lines in Africa and Australia, combining enormous power with the flexibility to negotiate tightly curved tracks with severe weight limits.
German railway engineering giants Krupp and Henschel also supplied conventional heavy steam locomotives, although by 1941 many of these were already out of action, requiring repairs or modification to withstand the rigors of desert operation.
In August 1941, just three years after the completion of the showcase project, Britain and Russia invaded Iran on the pretext of foiling a German-backed coup. In reality Britain had moved to secure one of the Empire's primary sources of oil -- and establish a wartime supply route to the Soviet Union via the Caspian Sea.
The following month, the southern section between Bandar Shahpur and Tehran was taken over by the British Army's Royal Engineers regiment while the line north of the capital was under Soviet control. New railway yards, extra locomotives and rolling stock and experienced railwaymen from Britain and the US drove a massive increase in capacity during the war.
In 1941, just one freight train a day could use the line, moving less than 1,000 tons of freight. Two years later, with the US Army Corps of Transportation (USATC) now in charge, this had increased to 5,400 tons a day.
Heat, dust, altitude and a shortage of water for steam locomotive boilers -- and for their crews -- made the railway a very harsh environment. But by 1944 capacity was up to 6,489 tons per day, thanks to the introduction of US-built diesel locomotives and thousands of extra freight cars.
When the European conflict of World War II ended in May 1945, aid convoys to Russia ceased and USATC handed control of the Trans-Iranian Railway back to Britain, which quickly passed it on to Iranian State Railways, predecessor of the current Islamic Republic of Iran Railways.
Today, despite decades of economic sanctions, Iran is investing heavily in expanding and upgrading its rail network. Almost 1,100 km of new railway has been completed over the last seven years, linking provincial capitals to Tehran.
Construction began on the country's first high-speed railway in 2015, linking Tehran to Isfahan via Qom at speeds of up to 300km/h. A second high-speed line between Arak and Qom is also under construction. Both projects are backed by Chinese credit and engineering expertise.
In April 2020, a $3.56 billion deal was signed to build a 510 km electrified line branching away from the Trans-Iranian Railway at Ahvaz and crossing the Zagros mountains to Isfahan.
China has become increasingly involved in Iranian infrastructure as part of its 'Belt and Road Initiative' aimed at expanding its influence across the region.
In 2015, China unveiled plans for an ambitious 2,000-mile high-speed railway from Urumqi in Xinjiang province to Tehran via the capital cities of Kazakhstan, Kyrgyzstan, Uzbekistan and Turkmenistan.
As well as a new Iran-Turkmenistan link and a standard gauge railway into Afghanistan completed in December 2020, there is a proposal to reopen a line to Azerbaijan, creating a new corridor between Iran, Russia and Georgia.
Work also continues on the Astara-Rasht line along the western side of the Caspian Sea. This will complete a north-south corridor linking Russia with the Persian Gulf. A rail bridge across the River Astaraçay border in Astara is complete, but the line currently terminates just inside Iran.
UNESCO World Heritage status is a highly coveted title that puts a site firmly on the global tourism map. It can help to deliver additional funding for maintenance and restoration work, opens doors for expert advice and studies and potentially deliver a huge uplift in visitor numbers.
For some places, the latter can become a double-edged sword, with over-tourism threatening the very environment that brought them to UNESCO's attention in the first place.
That fate is unlikely to befall the Trans-Iranian Railway just yet. Visiting Iran remains a tricky proposition for many foreigners and relationships with Western nations continue to be strained. However, Littler hopes to return when conditions allow, taking his more adventurous customers back to enjoy the country's cultural and engineering highlights.
"If and when the situation improves we would certainly look at returning to this wonderful destination," he concludes.
"During talks with Iranian Railway management a few years ago they voiced interest in running a tourist train between Garmsar and Pol-e-Safid, using a restored German steam locomotive. I'm sure that project has been put on ice but who knows what might happen if and when things improve?"
For those able to experience it, now or in the future, this incredible railway offers an unforgettable journey across a country that few outsiders get the opportunity to see.