Judge Dee, or Judge Di, is a semi-fictional character based on the historical figure Di Renjie, county magistrate and statesman of the Tang court. The character appeared in the 18th-century Chinese detective and gong'an crime novel Di Gong An. After Robert van Gulik came across it in an antiquarian book store in Tokyo, he translated the novel into English and then used the style and characters to write his own original Judge Dee historical mystery stories. The series is set in Tang dynasty China and deals with criminal cases solved by the upright and shrewd Judge Dee, who as county magistrate in the Chinese imperial legal system was both the investigating magistrate and judge. Dee Goong An The Judge Dee character is based on the historical figure Di Renjie (c. 630 – c. 700), magistrate and statesman of the Tang court. During the Ming dynasty (1368–1644) in China, a "folk novel" was written set in former times, but filled with anachronisms. Van Gulik found in the 18th-century Di Gong An (; lit. "Cases of Judge Dee") an original tale dealing with three cases simultaneously, and, which was unusual among Chinese mystery tales, a plot that for the most part lacked an overbearing supernatural element which could alienate Western readers. He translated it into English and had it published in 1949 under the title Celebrated Cases of Judge Dee. Van Gulik's stories This gave van Gulik the idea of writing his own novels, set with the similar Ming anachronisms, but using the historical character. Van Gulik was careful in writing the main novels to deal with cases wherein Dee was newly appointed to a city, thereby isolating him from the existing lifestyle and enabling him to maintain an objective role in the books. Van Gulik's novels and stories, often referred to as the Shih Ti, made no direct reference to the original Chinese work, and Celebrated Cases of Judge Dee is not considered to be part of the Judge Dee series. Initially Dee is assisted only by his faithful clerk, Sergeant Hoong Liang, an old family retainer. However, in The Chinese Gold Murders, which describes Dee's initial appointment and first criminal cases, the judge encounters two highwaymen, euphemistically called "men of the greenwood", Ma Joong and Chiao Tai, who attempt to rob him but are so impressed with his character that they give up their criminal careers and join his retinue