In the spring of 1963, a French geologist set out from Kabul to carry out a survey in Logar province in eastern Afghanistan. His destination was the large outcrop of copper-bearing strata in the mountains above the village of Mes Aynak. But in the course of boring for samples, the geologist stumbled on something much more exciting: an entire buried Buddhist city dating from the early centuries AD. The site was clearly very large – he estimated that it covered six sq km – and, although long forgotten, he correctly guessed that it must once have been a huge and wealthy terminus on the Silk Road.

Archaeologists in Kabul did a preliminary survey of the site, mapping it and digging test trenches, but before they could gather the enormous resources needed for a full-scale excavation, first the 1978 Marxist coup then the 1979 Saur Communist revolution and the Soviet invasion intervened. In the chaos of conflict that followed, the Soviets visited Mes Aynak to dig test tunnels into the hillside and investigate the feasibility of extracting its copper. Later, during the Taliban era, one of the abandoned Soviet tunnels became an al-Qaida hideout, while the remote valley became a training camp: the 9/11 hijackers stopped off here en route to New York. During the American onslaught of December 2001, US special forces attacked the tunnel: an unexploded rocket lodged in the roof and burn marks at the cave mouth still bear witness to the attack.

By the time French archaeologists returned in 2004, they found that the secret of the buried city was out. As had happened in many other sites in the country, a large and highly organised team of professional art looters, probably from Pakistan, had systematically plundered the mounds at Mes Aynak and, judging by the detritus they left, had found large quantities of hugely valuable Gandharan Buddha images: the remains of many painted stucco figures deemed too fragile or too damaged to sell were left lying around the looting trenches which now crisscrossed the site. Beside them, the archaeologists found empty tubes of glue and bags of fine plaster – evidence of attempts at restoration and conservation.

An archaeologist examines the remains of statues of Buddha at Mes Aynak. Photograph: Shah Marai/AFP/Getty Images

Things did not begin well. The first set of guards placed on the site in 2004 ended up shooting each other in a gun-battle; indicating, presumably, that profitable looting was continuing long after the site had passed into Afghan government control. But it was now beyond dispute that Mes Aynak was a discovery of major significance. In the months that followed, the excavators uncovered 19 separate archaeological sites in the valley. These ranged from four fortified monasteries, a Zoroastrian fire temple and several Buddhist stupas (commemorative monuments), through ancient copper working, smelting workshops, miners habitations and a mint, as well as two small forts and a citadel. They also found a hoard of Kushan, Sassanian and Indo-Parthian coins, more than 1,000 statues, and several perfectly preserved frescoes showing donor portraits and scenes from the life of the Buddha.

As more data slowly emerged from the ground, it became clear that the site was a major Buddhist settlement, occupied from the first century BC and to the 10th century AD, at a time when South Asian culture in the form of the Buddhist religion and Sanskrit literature were spreading up the Silk Route into China, and when Chinese scholars and pilgrims were heading southwards to the Buddhist holy places of the Gangetic plain: Sarnath and Bodh Gaya, and the Buddhist university and library of Nalanda, the greatest centre of learning east of Alexandria. Mes Aynak was clearly an important stopping-off point for monks heading in either direction.

Then, in 2008, the Chinese returned, this time not as pilgrims or scholars but instead as businessmen. A Chinese mining consortium – Chinese Metallurgical Group and Jiangxi Copper Co – bought a 30-year lease on the entire site for $3bn (£2bn); they estimated that the valley contained potentially $100bn worth of copper, possibly the largest such deposit in the world, and potentially worth around five times the estimated value of Afghanistan's entire economy. Afghan president Hamid Karzai's government hailed the mine as a key component in bringing about a national economic resurgence that would not be dependent on aid and military spending – which, between them, currently make up 97% of the legal economy – or, indeed, the profits of the illegal opium trade. Some observers estimated that the project could bring in $300m a year by 2016 and provide about $40bn in total royalties to the Afghan government.

Gold and jewels discovered at Mes Aynak. Photograph: Jerome Starkey/FlickrVision

Copper had created the site and probably drew the Buddhist monks to the valley in the first place, but now it would imminently lead to its complete destruction. In order to retrieve what they could before the site was levelled, the archaeologists of the French Archaeological Mission in Afghanistan (Dafa) began a major rescue dig to which the Chinese contributed $2m, the US $1m and the World Bank $8m: by providing the cash, everyone hoped the mine would not be halted by protests – the press had already begun comparing the destruction of the major Buddhist site at Mes Aynak to the dynamiting of the Bamiyan Buddhas by the Taliban in the summer of 2001.

As well as 200 armed guards, there is currently an international team of 67 archaeologists on site, a mixed group of French, English, Afghans and Tajiks. Serious technology is being deployed to record the remains: ground penetrating radar, georectified photography and aerial 3D images are being brought together to produce a comprehensive digital map of the ruins. This effort is being backed up by more traditional techniques: the sweat of about 550 pick-axe wielding Logari labourers. This summer that number is due to increase to 650. This will make Mes Aynak the largest rescue dig anywhere in the world.

A Buddha head from Mes Aynak at the National Museum of Afghanistan, Kabul. Photograph: MCT via Getty Images

To get to Mes Aynak you must make a mildly risky two-hour trip from Kabul. Logar is still the Taliban's principal route into Afghanistan from their Pakistani safehavens and the highway is frequently subject to IED attacks aimed at the Nato-led Isaf convoys.

I was driven to the site by Philippe Marquis, the ebullient director of Dafa, who is famed in Afghanistan not just for his bravery and archaeological prowess, but also for keeping the best table and the best wine cellar in Kabul. Marquis has masterminded the Mes Aynak project since its inception, and drives back and forth two or three times a week in his beret and dapper corduroy waistcoat, supervising both the digging on site and the fundraising and administration that takes place at the Dafa office in Kabul.

On a bright, cloudless spring day we drove together through the Kabul valley, past fortified mudbrick compounds surrounded by fields green with ripening barley and divided up with windbreaks of poplar. Eventually, we turned off the main road on to a bumpy track leading into the hills, in April still etched with drifts of snow. As we drew close, we found ourselves surrounded by the camouflaged and flak-jacket wearing guards of the Afghan army: an entire regiment armed to the teeth with heavy machine guns is at work in this remote valley to keep this lucrative Chinese investment safe.

Driving uphill past a succession of checkpoints, the small camp for the diggers and the huge Chinese mining compound with its conning towers, drilling pylons and lines of identical blue-roofed barrack blocks, we arrived at length in a high-altitude valley of stark magnificence. Here, the dark ruins stand out against the thick snowfields of the Koh Baba Wali rising behind. Barren grey-clay walls and mudbrick structures rose out of the ground, their original form eroded by 2,000 years of winter winds, so that from a distance all that seemed to remain, amid the diggers, wheelbarrows and string mapping grids, was a maze of brick walls. But Marquis could see order where I could not, and instantly identified the different sites and speculated on what they were once used for.

A courtyard of a monastery at Mes Aynak. Photograph: MCT via Getty Images

With Marquis in the lead, striding forward holding a ski stick, we marched up the hill. Handles of ancient amphorae, painted fragments of geometric decoration lay strewn around our feet like autumn leaves – hundreds of broken shards poking out of the mud. At the top we dived into a succession of monastic complexes where lines of sitting Buddha statues faced onto small slate stupas with classical columns covered with plastic sheeting. On the walls, sometimes almost invisible, at other times startlingly vivid, were the outlines of delicate wall paintings on plaster. Some showed lines of standing Buddha figures holding lotus flowers; the images were arranged four on each wall, 16 in total for each chapel. Others showed the seated Buddha surrounded by a body halo and nimbus, the Bodhisattva Maitreya in a cape or the evil child-devouring yaksha Atavika who the Buddha miraculously converted to his dharma. Several images showed the magnificently booted Kushan noblemen in red and white robes who originally paid for the complex.

The valley, emphasised Marquis, was an important centre of copper mining in antiquity. In one place he pointed out an ancient centre of crushing, refining and smelting, where the diggers had found a blanket of fused copper slag 12m (40ft) high. Marquis believes the copper workings to be central to understanding the ruins. Given the unusual grandeur of the Buddhist temples and palaces in the settlement, Mes Aynak might once have been a theocracy like Tibet, with the monks exploiting the copper reserves as a source of power and profit, not unlike the Cistercian monks who dominated the pre-industrial economy in many parts of medieval France and England.

A Buddhist stupa – commemorative monument – inside a monastery at Mes Aynak. Photograph: MCT via Getty Images

Mes Aynak seems to have remained a wealthy centre until a period of slow decline began in the eighth century; the settlement was finally abandoned 200 years later. The archaeologists have found a layer of ash and charcoal and smashed statues, which seems to have coincided with the slow rise of the Islamic Ghurid dynasty in the area. Already, stories of Afghanistan's former wealth had entered folklore. When the medieval physician Abu Ubaid al-Jizani was writing in the early 11th century, it was widely known that Afghanistan's former rulers "have been famous and celebrated from the most remote ages for the abudance of their riches, the vastness of their treasures, the number of their mines, and their buried wealth. For that country is littered with mines of gold, silver, rubies and crystal, as well as lapis and garnets and other precious things."

However, 500 years earlier, when Mes Aynak was at the peak of its prosperity between the fifth and seventh century AD, Buddhism was spreading over the Hindu Kush and the region was the meeting place for the ideas and peoples of the civilisations surrounding Central Asia. Its mountains and valleys were a major intellectual crossroads where the Hellenistic, Persian, Central Asian, Tibetan, Indian and Chinese worlds met and fused. Today, of course, part of what is so fascinating about the civilisation of the cities of the Silk Route is the sheer remoteness of these exotic-sounding places. Yet what most distinguished Mes Aynak in the early first millennium AD was the opposite: the fabulously wealthy and cosmopolitan nature of the society that thrived there.

At this period, Afghanistan was the epicentre of classical globalisation: midway on the trade route from Rome to China, traders came to Afghanistan from all over the world, bringing painted glass from Antioch, inlaid gold vessels from Byzantium, porphyry from Upper Egypt, ivories from South India, carpets from Persia, horses from Mongolia and Siberia, and lacquers and silk from the China coast. It was through these now-remote valleys that ideas of art, decorum, dress, religion and court culture passed backwards and forwards, east to west and back again, mixing and melding to create the most unexpected conjuctions. The slowly decaying remains of the culture that emerged from this extraordinary clash and fusion of civilisations still litters much of Afghanistan and northern Pakistan.

One of the centres of this process was the region of Gandhara, whose centre lay around Peshawar in the North-West Frontier province of Pakistan. After the death of Alexander the Great in 323BC the Greek garrisons of India and Afghanistan found themselves cut off from their Mediterranean homeland, and had no choice but to stay on, intermingling with the local peoples, and leavening Indian learning with classical philosophy. The Bactrian Greeks survived for 1,000 years, long after Greek civilisation had disappeared in Europe. Kings with names such as Diomedes of the Punjab, Menander of Kabul and Heliochles of Balkh, ruled over a remarkable Indo-Hellenistic civilisation that grew up in what is now the Taliban heartlands of the Federally Administered Tribal Agencies (Fata) and eastern Afghanistan. This civilisation was later cross-fertilised by new influences brought by the Kushans who succeeded the Bactrian Greeks as rulers of Afghanistan, while adopting much of their culture.

Kushan Gandhara was Buddhist in religion but worshipped a pantheon of Greek, Roman, Iranian, Hindu and Buddhist deities. It left behind it a legacy of finely constructed and richly designed Buddhist monasteries such as Mes Aynak. In the area between Kabul and Peshawar, one fifth-century Chinese traveller counted no fewer than 2,400 such shrines – as well as a scattering of well-planned classical cities, acropoli, amphitheatres and stupas. Gandharan art used motifs borrowed from classical Roman art, with its vine scrolls, cherubs and centaurs, but its principal icon was a handsome, languid, meditating Buddha, dressed in a Greek toga.

Afghan archaeologists at work. Photograph: Jerome Starkey/FlickrVision

The Hellenistic influence of Gandhara is immediately apparent at Mes Aynak – in the Corinthian capitals that support the plinths on which the Buddha meditates; in the bearded tritons who seem to have wandered off some Mediterranean sarcophagus; and in the terracotta figures of ascetics that closely resemble those found at the Bactrian Greek site of Ai-Khanoum with their pointed goatee beards and intense wide-eyed stares. There is much Indian influence too. Several black-schist figures have been dug up showing the Buddha standing, meditating, preaching and fasting. In one image, now in the Kabul Museum and known as The Pensive Bodhisattva, the young Prince Siddhartha is shown sitting under a Pipal tree, clad in dhoti, turban and necklaces. His muscles ripple beneath the diaphanous folds of the toga. The saviour's hair is oiled and groomed. His face is full, round and classical: the nose small and straight; the lips firm and proud. Art historians believe the sculpture came from a workshop located at Bagram, under the US airbase whose notorious prison was recently handed over to the Afghans under pressure from Karzai.

Yet as time went on, Indian and western classical motifs increasingly give way to an ever-greater eastern influence, as the T'ang Chinese army moved along the sides of the Taklamakan desert and the Tarim basin to take over Xinjiang to the immediate north-west of Afghanistan. One of the most exquisite finds at Mes Aynak is a gilt Buddha head, with eyes half closed, poised on the threshold of enlightenment; it feels more Burmese than Central Asian. Fabulous frescoes reveal the increasing influence of both Uyghur and Chinese mural techniques: the compositions look increasingly like the work uncovered by the great turn-of-the-century Silk Road archaeologist Aurel Stein at the Cave of a Thousand Buddhas in Dunhuang. The delicacy of the silks, the elongated eyes, and the lightness of the brushstrokes depicting white iris-like flowers show the growing influence of T'ang Chinese art.

"In this ground," wrote Stein of the Silk Road cities he excavated, "time seems to have lost all power of destruction." The same is equally true of Mes Aynak.

The same process that can be seen in the art dug out of Mes Aynak – a surprisingly strong western presence slowly giving way to Chinese influence from the east – is a story that is likely to be repeated all over the region in the next few decades. For there is a growing conviction these days in Afghanistan that China could end up the ultimate winner here, after the US withdrawal in 2014.

Although the Chinese maintained close contacts with the Taliban regime and their Pakistani ISI backers during the 1990s, they pulled back from interfering in Afghanistan after the US-installed Karzai regime in December 2001, and, until recently, even economic contact was modest: last year there was only $234m in trade between the two neighbours. But this is now beginning to change.

In September 2012, the Chinese security chief, Zhou Yongkang, visited Kabul and announced a turnaround in Chinese policy. As well as signing contracts for more mining and oil exploration, the Chinese announced plans for road- and rail-building projects linking north-east Afghanistan with western China through the Wakhan Corridor. A railway is now being planned from Kashgar to Iran via Herat; another will run from Uzbekistan to Mazar-i-Sharif. China has also made a start on security co-operation with Karzai's regime, and is currently training a first batch of 300 Afghan policemen. The politics of this are delicate, but, potentially, extremely important. China is possibly the only country to which the Pakistani security establishment defers. If China continues to invest in Afghan mineral resources, and the roads and railways with which it can extract them, it will expect Pakistan to protect its interests and not allow the Taliban to disrupt these operations in Afghanistan. This could hold out the best hope for future peace in Afghanistan.

The potential is enormous. Geologists estimate that Afghanistan holds vast hydrocarbon and mineral deposits that could be worth $1tn – including oil, gas, copper, iron, gold and lithium that China will need in the decades ahead if its economy is to expand. Yet Mes Aynak shows the scale of the problems that will have to be overcome. Most of the mineral deposits in Afghanistan are in the south-east of the country, where the Islamist insurgency is strongest. Despite massive investment in the fortified camp at Mes Aynak, and enormous security, there have been several Taliban attacks on the Chinese mining camp and most of the 150 Chinese staff in residence recently fled back home. One British observer who worked with the Chinese at Mes Aynak remains sceptical about their resolution: "They are scared, confused, and have little understanding of Afghanistan," he told me. "They may well be regretting ever having got involved in Mes Aynak. Their workmen are attacked – there was another bomb last week, and they have no Dari or Pashto speakers. Rather than ruthlessly efficient, I have found them sweet and a bit hopeless." Certainly, their camp is currently empty except for security and caretakers.

In the meantime, excavations continue. Marquis says he has enough resources for a full rescue dig; what is not clear is how much time he has. Mining was due to begin in January, but the Taliban attack has given him at least until the summer to continue. How long he has after that remains unclear.

• William Dalrymple's Return of a King: The Battle for Afghanistan 1839-42 is published by Bloomsbury