With the infighting at the Tibetan court threatening to tip the country into civil war, and the Tang empire maintaining its stranglehold on the lucrative Silk Route, Tibet was in trouble. The Silk Route was vital for an economy that thrived on the export of luxuries such as musk, yaks’ tails and fragrant honey. Faced with an impenetrable wall of Chinese soldiers to the east, in desperation the Tibetans turned to a new and dangerous power in the west: the Arabs. Forging an alliance with them, the Tibetans moved into the lands known today as Tajikistan, Kyrgyzstan and Uzbekistan. Now they could trade with the West. Yet, by the early 750s, the Chinese were threatening to close these routes down too.

Then suddenly, in the winter of 755, everything changed. The Tang empire was dealt a blow from which it would never really recover. It came from one of the emperor’s most brilliant generals, a man called An Lushan. Though a favourite of the emperor, he surprised everybody by launching a military coup against the Tang dynasty. With his own private army Lushan waged war on the emperor’s armies, defeating them over and over again, until he took the capital, Chang’an. He set himself up as emperor and in 756 announced the end of the Tang and the beginning of his own dynasty. It was clear to all that the balance of power in Asia was about to change. And in that same year Trisong Detsen was enthroned in Tibet.

At first the youthful new tsenpo was able to sit back and watch as China descended into chaos. In 757, Tang loyalists assassinated Lushan and called on the help of the Uighurs, a fearsome Turkic people, to wrest back control of China. By 763, the rebellion was over and a Tang emperor was on the throne again. But millions had died in the fighting and an accompaying famine, and the empire would never recover from its wounds. The Uighurs roamed the country, taking what they wanted. And all over the empire, especially in the far-flung colonial territories, local rulers threw off the yoke of rule from Chang’an.

Now Trisong Detsen made his first move as leader of the fearsome Tibetan army, sending his soldiers back onto the Silk Route. This proved spectacularly successful. Nothing illustrated the depths to which the Tang dynasty had fallen as dramatically as the Tibetans’ daring conquest of Chang’an that winter. Though it only lasted a couple of weeks, the Tibetan occupation of the Chinese capital set the tone for a new phase of Sino-Tibetan relations. While the Chinese annalists continued to write as if their emperor was lord over all neighbouring ‘barbarians’, the Chinese now had to treat the Tibetans as equals, and reluctantly agree to treaties placing the Sino-Tibetan border only a few hundred miles from their capital. Though Chang’an remained in Chinese hands, the Tibetans camped frighteningly close by and attacked almost every autumn, the traditional nomadic campaigning season. One Chinese general lamented that, when faced with the might of the Tibetans, the Chinese forces were nothing but an easily frightened mob.

One after another, the western cities, China’s gateway to the Silk Route, fell to the Tibetan army. Since whoever controlled the Silk Route controlled trade, wealth now flowed into Tibetan, instead of Chinese, coffers. One Chinese city held out against the Tibetans with particular tenacity: Dunhuang. For eleven years inhabitants were placed under siege by the Tibetan army. When, after the first year, the besieged governor talked of burning the city and fleeing, the commander of the Chinese troops murdered him and took his place. After seven more years of siege, the commander managed to sell off the city’s supplies of silk to the Tibetans in exchange for food. But, two years later, there was no more food, and the commander went onto the city walls and offered to surrender as long as the Tibetans promised to let him and his people stay in the city. The Tibetans agreed.

The citizens of a Chinese city conquered by the Tibetans had to get used to a new way of life. The way the land was apportioned and taxes were levied, the way contracts and letters were written, all this altered. Tibetan became the language of government, law and business. Even the dates changed, the Chinese system of identifying the year by the name of the current emperor and the year of his reign being replaced by the twelve-year animal cycle of Tibetan astrology. Though this resulted in the problem that the year of the sheep, for example, came up every twelve years, you could explain which year of the sheep you meant by consulting the royal annals and checking what had happened in that particular sheep year. A few centuries later, the twelve animals were conjoined with five elements, so that sixty years would pass before you encountered another year of, for example, the wood sheep.

In any case, a few Tibetans took the highest posts in Dunhuang, making sure things ran smoothly, while the Chinese inhabitants had to wear Tibetan clothes, learn to write in the Tibetan alphabet, and work in the Tibetan civil service. The first generation to submit to Tibetan rule felt keenly the loss of their cultural identity, as the annals of the Tang dynasty tell us: ‘The inhabitants of the city all adopted foreign dress and submitted to the enemy; but each year when they worshipped their ancestors they put on their Chinese clothes, and wept bitterly as they put them away again.’ Indeed, Tibetan documents confirm that the Chinese were second-class citizens, with Tibetans in the lowest government positions still outranking Chinese in the highest.

Popular revolts were not uncommon, and at least once the Tibetan rulers of Dunhuang were killed in a Chinese uprising. Yet Tibetan culture thrived in Dunhuang, and later generations, some of them from mixed marriages, grew up learning both the Tibetan and Chinese languages. Indeed, the city was to play a fateful part in the preservation of Tibetan culture. At the end of the tenth century, thousands of manuscripts were placed in a nearby cave and sealed away, forgotten until their rediscovery in the twentieth century. These are now the earliest Tibetan documents extant anywhere in the world.

By the time Dunhuang fell, the Chinese emperor could see that there was no way the Tang dynasty was going to regain its former glory, so he agreed to a peace treaty allowing Tibet to keep its conquests on the Silk Route. Tibetan prisoners were freed and allowed to return to Tibet. In response, Trisong Detsen freed eight hundred Chinese prisoners: ‘generals, warriors and Buddhist monks’, according to the Tang Annals. Then in the early spring of 783, the two sides came together to formalise the treaty.

At the new border between Tibet and China, the city of Qingshui, a great altar was set up. On either side of the altar were massed ranks of Tibetans and Chinese, two thousand of each. Half were soldiers, standing with drawn weapons. The air must have been heavy with threat, and at first things did not go smoothly. Though both sides had agreed to solemnise the treaty by sacrificing an ox and a horse, the Chinese general, sickened by the idea of the treaty, demanded that a sheep, a pig and a dog be used instead. The Tibetans agreed, but nobody could find a pig, so the Tibetan general produced a wild ram instead. In accordance with the old custom, the animals were killed and their blood was collected in two bowls. The Tibetans and Chinese each took a bowl and smeared their mouths with the blood. Then the Tibetan general suggested that both parties should go into a Buddhist temple, temporarily set up in a tent on the other side of the altar, to burn incense and swear the oath again. After that, the two generals drank wine together and exchanged gifts. The whole tense business was over.

The written treaty spared the blushes of the Chinese emperor, beginning with the words ‘the Tang possess all under heaven’ before going on to cede all of the western regions previously held by the Chinese to the Tibetans. The Sino-Tibetan frontier was now established at Qingshui, at the eastern edge of modern Gansu province – perilously close to the Chinese capital. And there it remained until the fall of the Tibetan empire. Despite the favourable terms of the treaty, the Tibetans soon began to flout it, raiding further and further across the border, and taking territory north of the capital, effectively surrounding China on all sides except the east. The Chinese were not about to take this humiliation lying down. An ambitious Chinese general secured an alliance with the Arabs and the Uighur Turks. It was a bold move, and one that hurt the Tibetans, as they were drawn into a long war on their western frontiers with the Arabs, who were enjoying a period of great strength under the famous caliph Harun al-Rashid. At the same time, the Uighur Turks were now fighting the Tibetans along the Silk Route.

Yet in the end these alliances were of limited benefit to China. A decisive Tibetan defeat of a joint Chinese–Turkic army in Central Asia in 791 put paid to Chinese ambitions to seize back control of the Silk Route. It would be nearly a thousand years before China regained these Central Asian territories, which are known today as the province of Xinjiang. It was the Tibetan empire that now bestrode the Silk Route, its borders reaching well beyond the Pamir mountains to the west, and deep within China to the east. Trisong Detsen had radically changed the balance of power on the Asian continent. At the same time, he was reshaping Tibetan society with his revolutionary decision to adopt Buddhism as the state religion.

Trisong Detsen had made his mark in the international arena of politics and war. He had shown the scale of his ambition in the conquest of the Chinese capital, and the strength of his resolve in holding Tibet’s imperial borders against attacks by the Arabs, the Turks and the Chinese. In this he had surpassed the achievements of his ancestors, even Songtsen Gampo, the greatest of the tsenpos. And he had similar ambitions for Buddhism in Tibet. Everything that had been done by his predecessors in a haphazard and piecemeal fashion, he would do properly.

Trisong Detsen’s achievements would shape not only the future of Tibet, but that of Mongolia and China as well. His twin concerns, to expand the empire and spread Buddhism, made the Inner Asian reaches of the Tibetan empire receptive to Tibetan Buddhism long after the fall of the empire itself. This would make it possible in later centuries for Tibet to enter into relationships with the Mongols based on their shared religious heritage. It also led to China being governed for centuries by two Inner Asian dynasties that followed Tibetan Buddhism: first the Mongols and then the Manchus. Thanks to Trisong Detsen, Tibet’s cultural influence would extend much further than its frontiers.

In a corner of a Lhasa street there is a curious monument that is usually ignored by locals and tourists flocking to the nearby Jokhang temple. It is a stone pillar about ten feet high, with an ornamental cap, and it is one of the very oldest things in the city. It was put there in the 820s to mark a treaty between the Tibetan tsenpo and the Chinese emperor. By that time the Buddhist empire known as Greater Tibet spanned much of Central Asia, and had its talons in China and Southeast Asia. It was a military machine run from the great tented encampments of the tsenpo and his aristocratic ministers and generals. But it was not to last.

The tensions that emerged every time a new tsenpo came to power were the harbingers of the bitter schism that would one day tear Tibet to pieces. As the great tsenpo Trisong Detsen prepared to step down, they now came to the fore again. At first, it seemed that Trisong Detsen had done everything right when, in 797, he abdicated in favour of his eldest son, who had been preparing for the throne all his life. But something went wrong, and this son died after ruling for barely a year. Traditional Tibetan histories portray this doomed ruler as a naïve idealist, trying to put the Buddhist principles of universal compassion into practice by eradicating the difference between the rich and the poor. They also say that his reforms failed; some modern Tibetans claim that this is why they knew from an early stage that communism would never work in Tibet.

After this suspicious death another son was hurried onto the throne. Senaleg had not been prepared for power, so Trisong Detsen returned to the throne alongside him. But the old tsenpo only had a few more years left, and after he died conflict flared again. Senaleg had not strictly been the next in line for the throne, and there was another son who resented being passed over and now declared himself the rightful tsenpo. Senaleg had to regain the momentum, and he did. The challenger died in 804, and though the sources omit to say how, it is likely that it was murder that resolved the dispute.

Senaleg may have resorted to killing his brother, and he certainly did not blanch at waging war, but he followed his father’s Buddhist convictions. Buddhism penetrated the Tibetan court even more deeply during his reign. Two of his closest advisors were monk ministers who operated at the highest political levels, ensuring that the Buddhist initiatives of Trisong Detsen’s time weren’t allowed to stagnate. The translation of India’s Buddhist literature continued apace. Senaleg put his name to an edict standardising the Tibetan language and setting out firm rules for translators. In time, this would ensure the remarkable consistency of the Tibetan Buddhist canon; for now, it meant that thousands of pages of translations had to be revised and rewritten, a time-consuming and horribly expensive operation.

Meanwhile, the Tibetans continued to wage war at the borders of their empire. Their main opponents were now the Arabs, newly invigorated under Harun al-Rashid and his sons. Neither Tibetan nor Arab historians have much to say about these conflicts, though one Arabic source tells us that the Tibetans progressed as far as Samarkand, to which they laid siege. As for China, the Tang dynasty had been fatally wounded by the rebellions of the eighth century, and never convincingly stood up to the Tibetans again. The last of the epoch’s Sino-Tibetan treaties was sworn in 822, setting a border between Tibet and China on terms dictated by the Tibetans.

The pillar in Lhasa commemorating this treaty was originally one of three, the second being in Chang’an, and the third on the Sino-Tibetan border in Qingshui (at the eastern border of the modern province of Gansu). The writing on the pillar is in Tibetan and Chinese. The east face of the pillar sets out the terms of the treaty, the west face the history leading up to it, while the north and south faces give the names of the Tibetan and Chinese signatories. The treaty recalls the close allegiances between the Chinese emperors and Tibetan tsenpos of the past, especially the marriages of Chinese princesses to Tibetan tsenpos. Based on these, the relationship between the Chinese and the Tibetans is described as being like that between a father-in-law and a son-in-law. This phrase was a concession allowed by the Tibetan side to China’s sense of superiority over its neighbouring ‘barbarians’ and the Confucian ideal that the emperor should both conquer these barbarians and instruct them in virtue in a fatherly manner.

In the actual terms of the treaty, the two countries were equals, however. It reads: ‘The two countries, Tibet and China, guard the land and the frontier now in their possession. All to the east of that frontier is the land of Greater China, and all to the west is indeed the land of Greater Tibet. Thereafter both sides shall not struggle like enemies, shall not lead armies into war, and shall not invade and seize each other’s territory.’ The oath itself was solemnised in the terms of both Buddhism and the traditional ritual of animal sacrifice: ‘After the great governments under which the Tibetans are happy in the Tibetan land and the Chinese are happy in the Chinese land are united, a treaty that is made like this may never change. May we invoke the Three Jewels [the Buddha, his teachings, and those who follow them], the various saints, the sun and the moon, and the planets and stars as witnesses. Having declared this with solemn words, after the animals have been sacrificed and the oath has been sworn, the treaty is made.’

The Chinese annals recall the arrival of the Chinese delegates at the Tibetan court, which was still a mobile residence, a vast tented encampment, with the tsenpo’s tent in the very middle, surrounded by a fence of spears. Within this enclosure, halberds were planted in the ground every ten paces. In the middle, great flags flapped in the wind. At each gate to the residence there were armed guards and priests wearing bird-shaped hats and tiger girdles. Inside, the tsenpo sat on a platform ornamented with gold dragons, lizards, tigers and leopards. He was dressed in plain cloth, with his head bound in a turban of bright red silk. At his right-hand side was the prime minister, a Buddhist monk called Palgyi Yonten. The other ministers sat below the platform.

That night, a great feast with meat and wine was held, and the musicians played popular Chinese songs. The next day the swearing of the treaty was performed at a ceremonial altar. The small Chinese delegation sat on one side, and the ten chief ministers of Tibet, along with over a hundred clan chiefs, sat on the other. In the middle of the altar the monk prime minister Palgyi Yonten stood and recited the treaty, with a translator beside him for the benefit of the Chinese delegation. When the time came to make the animal sacrifice Palgyi Yonten stood aside, not protesting the killing, but declining to smear his lips with blood. After that was over, Palgyi Yonten presided over a Buddhist version of the oath in which ceremonial water was drunk before an image of the Buddha. Then, with mutual congratulations all round, the treaty was concluded. The ceremony had shown how Buddhism had come to an accord with the old traditions after the death of Trisong Detsen. The priests continued in their traditional roles, and the old ceremonies, including the sacrifice of animals, were still performed. But now monks performed Buddhist ceremonies alongside them.

By the time the treaty was signed, there was another tsenpo on the throne. His name was Tritsug Detsen, but he was better known as Ralpachen, ‘The long-haired’, after his long braided hair. Either Ralpachen was personally the most fervent of the Buddhist emperors, or he was deeply under the sway of Palgyi Yonten and other influential monks. During his reign, more of Tibet’s wealth was spent on Buddhist projects than ever before: perhaps more than was wise. New monasteries were under construction throughout the empire, and the cost of maintaining them fell upon the local population. Each monastery was granted two hundred households to provide it with food. The monastery owned these in the same way as an aristocrat. Though this system would soon break down, it would later return in an even stronger form than before, with the monasteries becoming the biggest landowners in Tibet.