To the white-bearded Afghan machinists, it felt like the cold war era had returned. After 25 years of working in a sprawling Soviet-built factory – a vestige of a war and occupation long extinguished – they suddenly spotted a new shipment of gleaming Russian equipment arriving last autumn on an 18-wheeler. The factory was abuzz. The Russians were back.

As the US-led war winds down and Russia reasserts itself in Ukraine and the Middle East, Moscow is also ramping up its investment in Afghanistan. It is rebuilding the relics of the Soviet occupation and promoting its own political and cultural prowess.

"You see Russia's interest in Afghanistan rising. It's visible," said Stepan Anikeev, the spokesman for the Russian embassy in Kabul. "We want to enlarge our role in the region. It's not only for Afghanistan, but for our own goals."

Russia's recent incursion into its neighbour, Ukraine, and its annexation of Crimea reflect its intent to maintain influence in some former Soviet republics. It is also reaching out to old allies farther afield. In Afghanistan, Russian officials point to their development activities as a counterexample to US aid projects, which many Afghans criticise as wasteful and misguided.

"The mistake of the last 12 years is that people were eager to give money, but without the proper strategy," said Russian ambassador Andrey Avetisyan, who was also based in Kabul as a young diplomat in the 1980s.

Many Afghans, including outgoing president Hamid Karzai, praise the Soviet model even though they fought a bloody 10-year war against the country's army, which invaded in 1979 to support an unpopular communist government.

"The Soviet money went to the right place. They were efficient in spending their money and doing it through the Afghan government," Karzai said in an interview with the Washington Post last month.

The new warmth between the Kremlin and Afghanistan was visible last month when the Afghan government released a message from Vladimir Putin marking the Islamic new year. It was the only such message made public, and was released at a time when the US and European governments are imposing sanctions on Russia for its expansion into Ukraine.

"I am certain that friendly ties and co-operation between Russia and Afghanistan in the future will add to the goodness and welfare of our people," Putin said in the message to Karzai, which was translated into Dari, the local language.

The Russian government has compiled a list of 140 Soviet-era projects that it would like to rehabilitate, according to the embassy. The Kabul Housebuilding Factory, the country's largest manufacturing facility, was the first to receive assistance last autumn: $25m in new equipment.

Moscow is also spending $20m to renovate the Soviet House of Science and Culture, constructed in 1982. The building, whose jutting angles reflected Soviet industrial design, was torn apart by bullets and rockets and became crowded with Afghan drug addicts. It is to reopen this autumn as the Russian Cultural Centre, a beacon for those with interest in Russia. "We want to expand our culture here," Anikeev said of the centre.

A worker prepares metal grinds used in walls in the Kabul House Building Factory. Photograph: Lorenzo Tugnoli/Washington Post

Afghanistan is still peppered with reminders of both the Soviet Union's war and its infrastructure projects. Its bread-making factory still produces thousands of loaves every day. Its housing complexes are among the country's most desirable (and the only ones with central heating).

"I hated the Soviets. I fought against them. They killed my father. But this is still the best place to live," General Labib Raeed said in his apartment in the Microryan, a Soviet-built housing complex.

Raeed is an officer in the US-backed Afghan army, but he's quick to criticise the US development effort – more than $100bn spent on non-military aid, including roads and schools. "The Americans were generous to donate so much money, but they gave it to the wrong people," he said.

The Microryan looks like it has been transplanted from a small Russian city. It is gray and unadorned, a stark contrast to the flashiness of Kabul's new homes and wedding halls. The four-bedroom apartments are cramped and austere, but they sell for more than $100,000.

Projects such as the Microryan were constructed during the height of the cold war. The Soviet Union continued building even as it waged war in the country throughout the 1980s. And then, on 15 February 1989, it was all over. The Soviets withdrew and their projects – the factories, schools, swimming pools atop Kabul hills – were left largely unattended.

Many of those projects managed to survive a civil war and the Taliban regime relatively intact. The housebuilding factory made the prefabricated walls from which Taliban leaders, including Mohammad Omar, built their homes and offices. Last year, it produced the walls for one of Afghanistan's biggest prisons.

The machinists who were in their 20s when they were trained by Soviet engineers are now middle-aged, but they're still working on the same equipment, with instructions in fading cyrillic characters. The new Russian technology is expected to be installed in the coming months.

Many Afghans question why Russia seems so interested in development here now, just as the west's assistance tapers off. The aid programme seems to many a calculated move reminiscent of the Great Game, the contest between the Russian and British empires for influence in central Asia in the 19th century.

Russian officials say that supporting Afghanistan makes sense given their regional interests. Afghanistan shares borders with three former Soviet states, which still receive considerable funding – and direction – from Moscow. And Afghanistan continues to be a major pipeline for narcotics that pour into Russia. Economic development, along with a Russian-funded counter-narcotics programme, could curb that illicit trade, officials hope.

Still, the timing of Russia's development effort has raised eyebrows. That country's most significant economic partnership with Afghanistan in recent years, a joint commission on "trade and economic co-operation," wasn't launched until 2012, the year the US withdrawal began.

There are other signs of a Russian revival here. The number of students studying Russian at Kabul University has doubled in the past two years. Russia, in turn, has doubled the number of scholarships it offers to Afghan students. The cultural centre will hold a vast library of Russian literature and offer language courses.

Russia has refused to send soldiers to support the Nato mission and has provided limited military aid. Although there is talk of equipping Afghan forces with more Russian-made Kalashnikov assault rifles, that plan has not been finalised and civilian projects remain the focus of the development effort.

"What the Soviets did here was really fundamental. They were thinking about the long term," said Ahmad, the head engineer of the housebuilding factory, who like many Afghans uses only one name.

For 30 years, Ahmad has walked past the same inscription every day on his way to the office.

"This factory," the inscription reads, "was built by the friendly government of the Soviet Union and was presented to the Afghan nation as a gift." The year "1962" is carved into the stone.

In the 1980s, as the war with the Soviet Union raged, the word "friendly" stood out as bitterly ironic. Now, with Russia's promise to return the factory to its days of productivity, the adjective is starting to resonate.

"We don't differentiate between the Americans and the Russians. Whoever wants to help us," said Ahmad. "We welcome the Russians back."

This article appeared in Guardian Weekly, which incorporates material from the Washington Post