In the tenth month of 765, at the walled town of Jingyang, there were fewer than ten thousand soldiers on the ramparts and a coalition of Uyghur and Tibetan cavalry outside.
The commander inside the town was sixty-nine years old. Guo Ziyi.
He made a decision. Open the gate. Take a few dozen men. Ride over to the Uyghur camp.
His officers blocked the door. They told him those people could not be trusted, that a commander does not walk into an enemy camp.
He answered that perfect sincerity moves even the gods, and therefore it would move men.
He went out without armour, in ordinary robes. When he came near the camp gate, the Uyghurs were standing there looking out. They saw him, and their faces changed.
Someone shouted that Lord Guo had come.
Then came the sound of weapons being put down.
From the Military Examination
He was born in 697 at Zhengxian in Huazhou, in what is now Shaanxi.
His family held office, but they were not one of the great houses. He came up by a road that most famous Tang ministers never used. Not the literary examination. The military one.
The Tang military examination tested three things: archery on horseback, archery on foot, and the lance. Then it tested the man himself, who had to sit in front of examiners and talk about strategy. He was tall, over six feet in the measurements of the time, and the histories call him striking in appearance, a superb shot and a fine lancer.
He passed at the top of the list.
A top pass in the military examination gave a higher starting rank than a literary degree, and he began as a staff officer in the imperial guard. From there he spent decades in frontier commands, and by 754 he was governor of Jiuyuan and deputy commander of the Shuofang army.
That year he was fifty-eight.
Fifty-eight years of peace, and a frontier officer had reached the ceiling. He probably thought so himself.
Then An Lushan rebelled.
The Battle at Jiashan
In the winter of 755 the armies of Fanyang came south and met almost nothing that could stop them. The emperor Xuanzong executed two of his own generals, then forced a third to leave his fortress and fight in the open, and two hundred thousand men were destroyed at Lingbao.
By the time the capital could not be held, Guo Ziyi was winning in the north.
He joined forces with Li Guangbi and smashed Shi Siming at Jiashan. A dozen commanderies in Hebei hoisted the Tang banner again. The two men had old grievances and could sit at the same table without speaking, but in the field they worked like one hand.
He was preparing to march north to Fanyang, the rebel home base, and end the war at its root.
Then Tong Pass fell. The emperor fled west. The crown prince took the throne at Lingwu and sent an order north: come back. Stop.
The chance to take the rebel capital was gone.
In 757 he came south with the Shuofang army alongside the prince who would become Emperor Daizong. At Xiangji Temple, south of Changan, the two armies met and fought from noon until dark. The Tang front line broke once; a general named Li Siye stripped off his upper garment, planted himself in front of the line with a long blade, and cut down dozens of men until the line held.
By nightfall the rebels were running.
Changan was recovered. Then Luoyang.
The emperor came out to meet him on the bank of the Ba River, took his hand, and said that the state, though it belonged to the Li family, had been rebuilt by him.

The Years Without Command
A general with too much credit seldom has an easy time afterwards.
In 758 nine military governors with six hundred thousand men surrounded the rebel An Qingxu at Xiangzhou. The court refused to appoint one commander and sent a eunuch, Yu Chaoen, who knew nothing about war, to supervise them. The nine armies fought their own separate battles and were routed.
Yu Chaoen blamed Guo Ziyi. The emperor took the opportunity to strip his command and leave him idle in the capital.
That was the first time. There were more.
In 763, with the frontier stripped of troops, two hundred thousand Tibetan soldiers came through the passes. The emperor fled east in the night. Changan fell again.
The court remembered that Guo Ziyi existed.
When the order reached him he had twenty horsemen. He gathered stragglers as he went, and by the time he reached Shangzhou he had four thousand men.
Four thousand against two hundred thousand. He did not fight. He bluffed.
By day his men raised extra banners and beat extra drums. By night they lit fires on every hill. The Tibetans concluded that the main Tang army had arrived, burned what they could, and withdrew west.
Changan came back a second time. The emperor returned and said that he had failed to use this man early enough, and that this was the result.
He was given an iron warrant of immunity and his portrait was hung in the Lingyan Pavilion.
In those years he was appointed, stripped, appointed, stripped, again and again. At one point the emperor wanted to give him the post of Director of the Secretariat, a title held by Li Shimin himself before he became emperor, and untouched by anyone in the two centuries since. He refused it three times in writing.
He said that discipline had collapsed, that every man was scrambling for advantage, and that if the fashion was to be reversed it had to start with him.
That was not empty courtesy. The eunuch supervisors of the Tang army had become a serious institution by then, and one man like Yu Chaoen could turn nine armies into a mob. Guo Ziyi had been damaged by that man more than once, and still met him politely.
He was not without temper. He kept it under the armour.
He was also hard on his own camp. Riding a horse inside the lines without orders was an offence, and when the son of his wife head nurse broke it, the officer on duty had him beaten to death on the spot. His sons came to complain and he drove them out of the tent.
When there was no fighting he put the men in the fields, and went himself. Half the grain that fed the army in the Guanzhong plain was grown that way.
After Jingyang, the Uyghurs stayed on the Tang payroll for decades, trading horses for silk along the border. Guo Ziyi was worth as much to the dynasty in that market as he was on a battlefield.
One Man on the Road
In 765 Pugu Huai En rebelled.
He had once been an officer under Guo Ziyi, a hard man of the Shuofang army, hounded into a corner by eunuchs until he brought Uyghurs, Tibetans, Tanguts and Tuyuhun south, three hundred thousand in the claimed count.
At Mingsha, Pugu Huai En died of a sudden illness.
The coalition did not scatter. It came on, and it surrounded Jingyang.
The Uyghurs had come because Pugu Huai En told them two things: the Tang emperor was dead, and so was Lord Guo.
So when Guo Ziyi appeared outside their camp, the Uyghur commander Yaoluoge could not believe it.
Guo sent a message in. He said that he was Guo Ziyi, that he had fought beside them to recover the two capitals, that they had taken his rewards, and now they had brought an army to his wall. Why.
The Uyghurs said they wanted to see him in person.
He went.
A few dozen riders. At the camp gate he had his men take off their armour. The Uyghur officers looked at one another, then one by one dismounted and came forward to bow.
He rebuked the Tibetans to their faces, described what they had done, and then spoke of the old days when they had fought on the same side. Yaoluoge said that they had been deceived by Pugu Huai En, that they had been told Lord Guo was no longer alive, and that otherwise they would never have come.
Guo asked them to turn on the Tibetans. They agreed, and poured wine to seal it.
When the Tibetans heard that the Uyghurs had made peace with the Tang, they struck camp in the night and moved west.
The Tang cavalry and the Uyghurs went after them and broke them at Lingtai, with losses in the tens of thousands.
A catastrophe that could have ended the dynasty was cancelled by one old man on a horse.
He was sixty-nine that year.
The Man Who Left the Gate Open
His life afterwards was long, too long to look like the ending of a soldier.
In 767 his son Guo Ai married Princess Shengping, a daughter of the emperor. The young couple quarrelled, and Guo Ai said something that could have ended the family: that she relied on her father being Son of Heaven, when his own father could not be bothered to be one.
The princess went back to the palace and repeated it. The emperor heard her out and said she did not understand. He told her that the man was speaking the truth, and that if Guo Ziyi had wanted the throne, the Li family would not be sitting on it.
Guo Ziyi tied up his son and came to the palace to await punishment.
The emperor told him that there was an old saying: unless you are a little deaf and a little blind, you cannot be the head of a household. Words spoken inside a young couple room are not worth hearing.
Guo Ziyi went home and still had his son beaten with rods.
In 781 the new emperor Dezong gave him the honorific of Imperial Father and took away his real authority. In the sixth month of that year he died, aged eighty-five.
He was given the posthumous name Zhongwu, the Loyal and Martial, and buried near the Jianling tomb of Emperor Suzong.
The histories say that he held the realm in his hands and no one at court feared him, and that his merit covered a generation and no emperor doubted him.
Read those two lines again and they stop sounding like praise. They describe the hardest thing a soldier can do. He commanded the strongest army in the world, he was stripped of it four times, and every time he handed it over without a word.
His gate stood open all year. Someone asked him to shut it. He said that he had a thousand people at his table and hundreds of horses in his stables, and that if he shut the gate nobody would know what was going on inside, whereas an open gate left nothing to be said.
Whether that story is literally true cannot now be checked. But an old general who lived to eighty-five, served four reigns and died surrounded by children, and left behind a story about an open gate, has told us something anyway.
He had eight sons and seven daughters. Most of the sons went to war with him; the second died in camp. A granddaughter became empress dowager and outlived seven reigns, and for decades nothing in the inner palace moved without her.
On the day he died the emperor cancelled court for five days, and the funeral was conducted on the scale once granted to Huo Guang of the Han.
Later ages remembered him more cheerfully. The Song painter Li Gonglin made a scroll called Removing the Helmet, showing the moment he walked into the Uyghur camp bareheaded. On the opera stage of the Ming and Qing there was a comedy called Beating the Princess, about a general who had married his son into the imperial family and had to apologise for it.
A soldier remembered not for the battle he won most beautifully, but for coming home alive, and coming home respected.