The Tang Code () was a penal code that was established and used during the Tang Dynasty in China. Supplemented by civil statutes and regulations, it became the basis for later dynastic codes not only in China but elsewhere in East Asia. The Code synthesized Legalist and Confucian interpretations of law. Created in AD 624 and modified in AD 627 and 637, it was promulgated in AD 652 with 502 articles in 12 sections and enhanced with a commentary (the 唐律疏議) in 653. Considered one of the greatest achievements of traditional Chinese law, the Tang Code is also the earliest Chinese code to have been transmitted to the present in its complete form. Origin and context The Tang code took its roots in the code of the Northern Zhou (564) dynasty, which was itself based on the earlier codes of the Cao-Wei and Western Jin (268). Aiming to smooth the earlier laws and reduce physical punishments (such as mutilations) in order to appease social tensions in the newly pacified Tang territories, it was created in AD 624 at the request of Emperor Gaozu of Tang. After further revisions in 627 and 637 under the influenceEmperor Taizong, the code was completed by commentaries in 653, under Gaozong. Organization and system of punishments French historian and sinologist Jacques Gernet has called the Tang Code "an admirable composition of faultless logic in spite of its size and complexity." The American sinologists Wallace Johnson and Denis C. Twitchett described it as "a very rational system of justice" in which "both the accuser and the officials involved had to be careful lest they themselves face punishment". The Tang Code contained more than 500 articles divided into twelve large sections (see right-side table). The penalty for an offence was determined according to two factors: Offence : The Tang Code clearly associated each offence with a penalty. Relational position : For relatives, this position was measured by the kind and duration of mourning that had to be observed for each degree of kinship. Relations outside the family were defined according to positions in a social hierarchy capped by the emperor himself. In this hierarchy, officials were higher than ordinary men, who were themselves superior to persons of servile status. For instance, a slave committing a crime against his master was punished more severely than if an ordinary person had committed the same crime. The same offence committed