In the first month of the year 692, in Luoyang, a man who had been chancellor of China for a few months was dragged into a prison cell and accused of treason.
The man who would interrogate him was Lai Junchen, the most feared of the empress Wu Zetian’s special prosecutors. Cases that came to him almost never came out of his hands alive.
The prisoner did not protest. He pleaded guilty at once.
His name was Di Renjie. He was sixty-two. And the sentence he pronounced against himself was this: the Zhou have replaced the Tang, and all things are made new. I was an official of the old dynasty. I should be executed with it. The charge is true.
He had just bought himself time, with a confession, in a system where time was the only thing a man could still acquire.
In English, Di Renjie is remembered as Judge Dee. The path runs through a Dutch diplomat, Robert van Gulik, who found a forgotten Qing novel about a Tang magistrate while he was posted to Chongqing during the Second World War, translated it, and then wrote more than a dozen detective novels of his own around the character. For decades Judge Dee was the West’s idea of the Chinese investigator: the official who walks into a locked room and comes out with the truth.
Real Chinese justice had older roots than the novels. In 1247, an official of the Song dynasty named Song Ci wrote a systematic manual for examining a corpse and reading what it had to say. It is the earliest surviving forensic text in the world, and it is centuries older than anything comparable in Europe.
Van Gulik is fiction. What follows is not. It is one of the strangest Chinese criminal cases on record, and in its own quiet way one of the earliest documents in Chinese true crime: the case file of a man who was accused under a system built to convict him. The strange thing about it is that the man the West calls the great detective spent this case fighting not to solve a crime but to survive one.

One. Seventeen thousand cases in a year
Start with what the official record actually says about him, because almost everything most people know about Di Renjie is invented.
He was born in 630, in Taiyuan in the north. He entered the civil service through an examination that tested knowledge of the classics rather than literary brilliance, and his first posting was as a junior official in a prefecture. Almost immediately, he was falsely accused of something. The case came before Yan Liben, a minister who was then touring the region as an inspector. Yan Liben cleared him, and then looked at him properly, and gave him a verdict of his own: a pearl of the river bend, a treasure of the southeast. He recommended him for a post in the judicial office of the provincial administration.
That office handled criminal cases, and it is where Di Renjie learned the law. Twenty years later it mattered.
In 675 he was promoted to assistant director of the supreme court of the Tang, with responsibility for reviewing criminal judgments. He arrived to find a backlog, and within a single year he cleared all of it. The cases touched some seventeen thousand people. Not one of them appealed.
The backlog was not an accident. A case that passed through the supreme court could destroy the man who decided it: rule too lightly and the throne called you soft, rule too harshly and a later reversal became your fault. The safest course was to leave the files where they were, and several successive assistant directors had taken it. Di Renjie worked through them one at a time, capital reviews alongside sentences of exile and penal labour, until the count of people caught up in them reached seventeen thousand.
That figure is in the official histories. So is the qualification that has to go with it.
Judging cases is not the same as detecting them. In the dynastic records, Di Renjie leaves behind almost no account of solving a murder. What he left behind was a reputation for judging quickly, judging fairly, and refusing to bend for the throne.
Two. The order he would not carry out
The first famous thing he did in that job was disobey the emperor.
In 676, a general named Quan Shancai made a mistake. He had the cypress trees around the tomb of the Emperor Taizong cut down. In the Tang, taking anything from an imperial tomb was sacrilege, and the emperor Gaozong, Taizong’s son, was furious. He ordered Quan Shancai put to death.
Di Renjie memorialised the throne: by the law, this man has not earned death.
The emperor, in front of the whole court, told him that Quan Shancai had cut down trees on his ancestor’s grave, that this made him an unfilial son, and that the man therefore had to die.
Nobody else said anything. Di Renjie did not move.
He said that to put a man to death for an offence that does not carry death would be to make the law untrustworthy, and that when the law cannot be trusted, ordinary people no longer know where to put their hands and feet.
Then he said something aimed at a different part of the emperor’s mind. If Your Majesty kills a general over a single cypress at Zhaoling, what will people a thousand years from now say about what sort of ruler you were. I dare not carry out this order, he said, because carrying it out is what would truly make you unjust.
The emperor calmed down. He withdrew the order, and he told the court historians to write the exchange down.
Three. Inside Lai Junchen’s prison
Sixteen years later the court was a different place.
Wu Zetian had taken the throne and renamed the dynasty Zhou. To break the old Tang families and anyone else who might resist her, she turned informing into a career. A bronze box was set up at court for denunciations. A true accusation brought rank and reward. A false one carried no penalty. Lai Junchen came up by that road. His method was not investigation but corroboration. The accused were brought in together and invited to incriminate one another, and the more names a confession contained, the more solid the case became. His associates are said to have written a manual on how to construct such charges, from the first step to the last.
He liked the instruments to be seen before they were used. He had a set of ten cangues, and each one carried a name: Settle the Hundred Veins, Cannot Breathe, Sudden Roar, Confess At Once, Lost Soul, Truly Treasonous, The Charge Is True, Dead Pig Sorrow, Only Wants To Die, Wants His House Destroyed. Most prisoners confessed after a look at them.
In the first month of 692, Lai Junchen accused Di Renjie and six other senior officials of treason. All seven were taken.
There was a rule in those cells, and it was not a private understanding. Lai Junchen had petitioned the throne for it in advance: a prisoner who confessed at the first interrogation was to be treated as one who had surrendered voluntarily, and death was to be remitted. A prisoner who did not confess would be tortured first and interrogated afterwards.
Di Renjie confessed immediately.
His explanation, on its face, was strange. He said that with the Zhou having replaced the Tang, all things were made new, and that as an official of the old dynasty he deserved to be executed with it. The charge was true.
It was also exactly right. Lai Junchen, seeing no resistance, stopped paying attention to him.
The last three characters the record gives him are fan shi shi, the charge is true. And in Lai Junchen’s set of ten cangues, the seventh was called by exactly that name.
What Di Renjie had admitted was his own guilt. He was not willing to admit anybody else’s.
Lai Junchen’s subordinate, a judge named Wang Deshou, came to him with a proposition. Your crime is settled, he said, and your life will be spared. But I would like a promotion, and for that I need more than you have given me. Would you mind naming your colleague Yang Zhirou as well. You shared an office once. Just say he was in it too.
Di Renjie shouted at him. Heaven and earth above, he said, and you would have me do this.
Then he drove his head into a pillar until the blood covered his face. Wang Deshou ran.
Four. The coat
Because he had confessed, half the case was already finished, and the guards relaxed further.
Di Renjie asked the jailers for a brush and ink. He tore a strip of silk from his quilt and wrote out his whole defence on it, from the beginning of the accusation to the end. Then he folded the silk and hid it inside his padded coat.
After that he went to Wang Deshou with a request so ordinary that nobody would think twice about it. The weather was turning warm. Could the coat be sent home so that his family might take out the padding and make it lighter.
Wang Deshou agreed. The coat went to Di Renjie’s son, Di Guangyuan.
Di Guangyuan opened the coat, and found the silk.
He went straight to the palace and put it in front of the empress.
Wu Zetian was taken aback. Di Renjie had confessed. Why was he now claiming innocence. She summoned Lai Junchen and asked. His answer was calm and polished. Di Renjie, he said, has been treated with courtesy. We have not even taken away his cap or his belt. He eats and sleeps normally. If the charge were not true, why would he confess to it.
She was not satisfied, and sent an official named Zhou Chen to the prison to look at the man.
Lai Junchen got word of the visit first. He had Di Renjie and the others dressed in clean caps and robes and arranged along the western wall of the cell, and then brought Zhou Chen in. Zhou Chen was a timid man. He walked in, kept his eyes fixed on the eastern wall, refused to look west, asked a few polite questions, and left.
That was not enough for Lai Junchen. A confession was good, but a confession plus a suicide note would be better. He had his clerks forge a letter from Di Renjie to the empress, thanking her for the sentence of death and acknowledging that he deserved it, and gave it to Zhou Chen to carry back.
That was the mistake.
Wu Zetian had Di Renjie brought before her and asked him two questions.
Why had he confessed to treason.
Because, Di Renjie said, if I had not confessed, I would already be dead under the whip.
Then why had he written the letter of thanks for death.
I never wrote such a letter, he said.
She showed it to him. The handwriting was compared. It was a forgery. The charge was dropped and he was spared, though he was stripped of his post and sent out of the capital to serve as magistrate of Pengze county.
Five. Why he confessed
The obvious question about all of this is why an innocent man would plead guilty on the first day.
Because in that cell, protesting innocence was the least useful thing available.
Lai Junchen’s process did not depend on what a prisoner said. It depended on whether the prisoner was going to die. Refusing to confess meant torture, and a confession extracted under torture was going to be written down in the torturer’s words anyway. Confessing bought two things. It stopped the immediate pain and kept the man alive. And it moved the case back into a procedure, where an appeal had at least somewhere to go.
In that room Di Renjie did two things. He admitted a crime he had not committed, to stay alive. And he wrote the truth on a piece of silk and had it carried out of the building sewn into his clothes.
That is not surrender. It is what a man does in a place where argument is impossible: he takes the one thing that can still speak, words on a page, and sends it over the wall.
One more exchange belongs here. At another point the empress asked him directly whether he knew who had been speaking against him. He said that if she judged him to have faults, he would correct them, and that if she judged him blameless, that was his good fortune. As for who had slandered him, he did not want to know, so that he might still be able to be a friend to the man.
Six. How the detective was invented
Wu Zetian brought him back. In 697 he was chancellor again. In the same year Lai Junchen was accused of treason himself, taken to the marketplace and executed. The histories note, briefly, that the crowd went for the body and that it was over quickly. The long terror of the special prosecutors ended there.
The thing Di Renjie is most important for is not judicial at all. In Wu Zetian’s last years he argued, persistently and finally successfully, that she should name as heir not her nephew but the deposed Tang prince Li Xian. He is remembered for that, not for cases. When he died in 700, the empress wept and said that the court was empty.
So where did the detective come from.
Part of the answer is Chinese. In the early Qing a crime novel appeared about Di Renjie, later usually called the Cases of Judge Dee, in which he solves impossible crimes. It belonged to a crowded genre. The Qing were fond of courtroom fiction whose heroes were upright magistrates of earlier dynasties and whose plots were largely invented.
The other part of the answer is European. In the 1940s Robert van Gulik, a Dutch diplomat posted to Chongqing, read that novel. He translated it into English, and it sold. When he could find no more Di Renjie detective stories to translate, he wrote them himself, more than a dozen of them over thirteen years, the last one finished shortly before his death.
So the English-speaking world learned to read Chinese detection through van Gulik’s Judge Dee. They are excellent detective novels. They are not case files.
The greatest case of Di Renjie’s life was a coat.
With a strip of silk and a padded jacket, he lifted himself out of a sentence that had already been decided. There was no detective in it, and no chain of deduction. There was a man who wanted to live, and a seam that everyone assumed would never be looked into.
In the record, the whole thing is one line long. The weather had turned warm, and he asked for his coat to be sent home, so that the padding could be taken out.