No one wrote down the date of the night Shazhou rose.
What survived is the shape of the story. Zhang Yichao and his men surrounded the office of the Tibetan commander. The garrison melted away. The commander fled.
Shazhou is Dunhuang.
From the year the town fell to that night was sixty seven years.
For sixty seven years the people of Shazhou had worn Tibetan dress, spoken two languages, and taken out their Tang clothes only to make offerings to their ancestors. After that night they had one thing to do: send word to Chang’an that the ground had come back.
The difficulty was the road.
The road ran through Tibet.
The Copybook
Zhang Yichao was born in 799, a native of Shazhou, from a local family of standing that had held command of the garrison for generations.
When he was born the town had been Tibetan for eighteen years.
How it was lost is set out plainly in the histories. When the rebellion of An Lushan broke out, the best troops of the western border were called into the interior one contingent after another, and the frontier was left thin. The Tibetans pushed east into the gap. In 763 they briefly entered Chang’an itself and set up a puppet emperor, then withdrew after fifteen days.
Over the next twenty years Liangzhou, Ganzhou, Suzhou and Guazhou went, one after another. By 781 only Shazhou was left.
The town held for eleven years.
The commander was Yan Chao. The governor, Zhou Ding, wanted to burn the town and run east; Yan Chao killed him, took charge and kept the wall. When the grain was gone and the weapons used up, he negotiated a condition: the town would open, but the people would not be moved.
The Tibetans agreed. When the gate opened, no one left.
That clause mattered. Because the people stayed, the language stayed, the clothes stayed, the monasteries stayed, and the family records stayed.
The eleven years were remembered in Dunhuang. What they remembered was one thing: we were not abandoned.
Tibet ran the corridor its own way. The chief officer was called the rtse rje, households were registered by tribe, the Han population was organised into tribes of its own, land was allotted by head, and tax was collected by household. Dress was changed too. In daily life a man wore Tibetan clothes; at the ancestral sacrifices he put on the Tang robe.
The documents of Dunhuang still hold the ledgers, the contracts and the monastery accounts of those years, written in a dense hand. Life went on. It was simply written in a different script.
Tax was not light. Among the papers are quantities of loan contracts, deeds for the sale of fields and houses, and monastery records of money lent out. The days were tight.
The occupation was not one event but a long squeeze. Tribute missions stopped, the road to office through the examinations closed, and a man of ambition in Shazhou had no career in the wider empire. That, as much as the tax, is what a generation remembered.
Zhang Yichao was not the first to push. There had been earlier protests, among them one by the households at the Yumen post station, which survives in a Chinese petition. It was put down.
Zhang Yichao studied at a monastery school. The Dunhuang monasteries ran schools that taught boys their characters and their sutras. The pupils copied books. They copied the Thousand Character Classic, they copied primers, and they copied model official letters, because when they grew up they would serve as clerks.
One thing survived from those years: a copy of a memorial, written out by a boy.
The memorial was by Feng Changqing, a famous general of the Tang. When An Lushan rose, Feng held Luoyang, was defeated, fell back on the Tong Pass, and was executed by the emperor. His last memorial said that his own death was a small thing and that he regretted only that he could not go on serving the state.
A boy in an occupied town copied the last memorial of a Tang general, and copied it carefully, in a steady hand.
The paper lay in a sealed library at Dunhuang for a thousand years.
One Night in Shazhou
The rising was not impulsive.
Before he moved, Zhang Yichao went to three groups: the great local families, the Buddhist clergy, and the armed men of the district. The families had men, money and standing. The monks had a following, and since the Tibetans were Buddhist themselves, monks could travel where officials could not. The armed men were both soldiers and muscle.
The same three groups served the Guiyi Army for the rest of its life.
His preparation was two things: he repaired weapons, and he farmed while he fought. He made his own arms and grew his own grain and did not wait for help from outside.
In 842 the Tibetan ruler Darma was assassinated. No successor had been settled, the queen and the chief minister each put up a candidate, and the Tibetan heartland fell into civil war. In the corridor the commanders each held their own district and looked to themselves.
Zhang Yichao raised his flag.
The words on it were four: the army that returns to the realm.
Shazhou and Guazhou fell in one push.
The town was taken by force.
The Tibetan officers were killed or ran. Zhang did not stop. He put every man who could hold a weapon into the ranks, and moved east, farming in season and fighting out of season.
He was fifty years old that year.
Ten Parties, Ten Roads
The first thing after the town came back was to send word.
From Shazhou to Chang’an was more than two thousand li, and every stage of it was held by Tibetan posts and patrols. One man carrying one letter would not get through.
Zhang Yichao copied the same report ten times and sent ten parties by ten roads.
In the parties were officers, clerks, and monks.
They took monks because the arithmetic was clear. The Tibetans were Buddhists, and a monk could walk where an officer would be stopped.
How the ten roads ran has never been set down. Later scholars have guessed: north around the Uyghur country, west through Khotan, north east toward the Tian De garrison. None of them was easy.
Some parties were intercepted. Some died in the desert. Some marched for years and were never heard of again.
The documents of Dunhuang include letters of passage and lists of gifts prepared for such missions, which suggests that more than one route was in use at the same time.
In 850 one party arrived.
It had come by the north east road, to the Tian De garrison near modern Baotou, where the frontier commander Li Pi helped it onward.
Among those who led it was a monk named Wuzhen. He stayed in Chang’an for a period, mixed with the monks of the capital, and went back to Dunhuang. The poems he left from that journey are preserved among the Dunhuang documents.

Only then did Chang’an learn that without a single soldier sent from the capital, Guazhou and Shazhou had come back on their own.
From the rising to the news arriving was two years.
Two years was fast.
An Edict From the Capital
In 851 a second mission set out.
It was led by Zhang Yitan, the brother of Zhang Yichao, with twenty nine men. They carried something heavier than a report: the old registers and maps of the eleven prefectures of Hexi and Longyou, drawn in the Tianbao years.
The eleven were Gua, Sha, Yi, Xi, Gan, Su, Lan, Shan, He, Min and Kuo.
The meaning of the gift was plain. These places had always been Tang. Here is the account.
They brought the old maps, not new ones. The old ones said: what we hand back is the original.
The Tang court issued a decree of praise and appointed Zhang Yichao defence commissioner of Shazhou and observer of the eleven prefectures, with the honorary post of minister of personnel and the title Duke of Nanyang.
His titles went up from there: defence commissioner, observer, military governor. Every one of them was granted by the Tang. He never called himself king.
In the eleventh month of that year the court established the Guiyi Army at Shazhou and made Zhang Yichao its military governor.
The two characters of the name mean returning to the right. They translate the name of an older garrison at Shazhou, the Doulu Army, set up there in the Shenlong years. The new army took up the name of the old one.
A frontier prefecture lost for sixty seven years had a Tang army again.
Zhang Yitan stayed in Chang’an. It was called a favour. It was a hostage.
The Tang attitude to the Guiyi Army was always two things at once. The court needed it, because no one else could hold the corridor. The court also watched it, because it had its own soldiers, its own money and its own ground. Zhang Yitan in Chang’an was the plain illustration.
The Procession on the Wall
The Guiyi Army did more than fight.
It first had to live.
Zhang Yichao repaired canals, opened fields, registered households and set up schools. He sent tribute to Chang’an and envoys to Khotan and to the Uyghurs. The canals of Dunhuang have names, and the documents record them one by one, with the days on which each household was allowed to water its fields.
He also fought. In the Dazhong years a Uyghur column came close to Shazhou, and he took troops out and drove it back. The popular ballad of Zhang Yichao tells that episode with great relish.
The Tibetans were not the only enemy. Uyghurs, Tuyuhun and other groups all wanted a piece of the vacuum. Most of the fighting of the early Guiyi Army was with these.
In 861 he took Liangzhou, and only then was the road through to the interior really open. Liangzhou was the hinge: with it a courier could go north east to the Ordos and then down to Chang’an, and without it every message had to go around the desert.
In 867 the court called him to the capital. He handed the army to his nephew Zhang Huaishen and went to Chang’an, where he was given land and a house.
Zhang Huaishen held the place for more than twenty years and asked the court for formal patents several times without getting them. In the end he died in an internal feud.
In 872 Zhang Yichao died in Chang’an, seventy four years old.
Cave 156 at Mogao, near Dunhuang, is generally taken to be his family shrine. On its south wall is a long painted scroll: the military governor Zhang Yichao setting out with his army.
On the north wall is the matching scroll of his wife, Lady Song, setting out. The two face each other. One is an army and one is a household.
The southern picture is a column: drums and horns and banners at the front, mounted guards in the middle, Zhang Yichao on a white horse in a red robe, musicians and dancers before him and ranks of cavalry behind. There are more than a hundred figures and eighty horses, spread across a wall.
The paint has faded. The order of the march is still legible.
Somewhere in the same century, on an island in the Mediterranean, a comparable thing happened. Crete had been taken by Arab fleets in the 820s, and the empire that called itself Roman went on calling the island its own for a hundred and thirty four years, until Nikephoros Phokas landed in 961 and took it back. The distance was shorter and the empire was not China, but the shape of the memory is the same: a province that kept its old name and waited for a government that might not come.
The ten roads were never painted.
The ballad of Zhang Yichao is a popular entertainment, and its hero is larger than the man in the histories. But the rising, the missions and the maps all check out.
The Guiyi Army lasted a long time after him, passing from the Zhang family to the Cao family, until the Western Xia annexed it in 1036, nearly two hundred years in all. That is another account.
The documents of the sealed library at Dunhuang were later divided into tens of thousands of pieces and scattered through London, Paris, Petersburg and Beijing. The name of Zhang Yichao appears many times in those papers.
But Dunhuang came back to the Tang on the strength of one road out of ten that got through.