History‎ > ‎

Foreigners in Tang Law

The Tang law codes are provided and discussed in a key text called the Tanglü Shuyi 唐律疏議, compiled in 652. It provides a penal code based largely on earlier legal codes and the Chinese classics, altogether comprising 502 articles. The Tang Dynasty (618-907) is described as having been quite cosmopolitan and international even in its early years. Looking through the laws for references to aliens, there are both accommodations made as well as restrictions. For example, article 48 provides extraterritorial arrangements for foreigners:



In cases of aliens of the same type who commit crimes against each other, defer to the laws of their native culture for both. In cases where they are of different types and commit crimes against each other, determine things via the law codes.

Commentary: “Alien” refers to barbarian countries where they have separately established hierarchies, each with their own customs and differing penal law codes. If they are of the same type and commit crimes against each other, inquiry must be made as to the system of their native country, and judgment made on them based on their customary laws. If they are of different types and commit crimes against each other – for example, being of Ko[gu]ryo and Paekche – the punishment will be determined via their respective national law codes.

One notable thing here is the mention of the two Korean kingdoms Koguryo and Paekche, both of which were conquered and subjugated by the Tang-Silla alliance in the 660s. Later on in Tang literature the peoples of the Korean peninsula along with their expats living elsewhere in China proper were generally thought of as being only subjects of Silla.

In contrast to this, article 88 displays a degree of xenophobia. Tang subjects are severely restricted from interacting with aliens at the border.


【疏】議曰:緣邊關塞,以隔華、夷。其有越度此關塞 者,得徒二年。以馬越度,準上條「減人二等」,合徒一年。餘畜又減二等,杖九十。但以緣邊關塞,越罪故重。若從關門私度人、畜,各與餘關罪同。若共化外蕃 人私相交易,謂市買博易,或取蕃人之物及將物與蕃人,計贓一尺徒二年半,三疋加一等,十五疋加役流。

Anyone trespassing past the border garrisons will suffer indentured servitude for two years. As for anyone covertly trading with aliens, if they acquire goods worth one chi of silk, it will be two and a half years of indentured servitude. An additional degree [of punishment] will be applied if it be worth three pi. Labor and exile will be applied if it be worth fifteen pi.

Commentary: Border garrisons are between China and the barbarians. Anyone trespassing beyond these garrisons will be subject to two years indentured service. If they trespass with horses, see the above article appropriate to one year of indentured service. With other livestock also reduce the sentence by two degrees to ninety lashes with a cane. The crime of trespassing is only major with border garrisons. If people [and their] livestock covertly pass through a gate, each will be [judged] the same as the other border-related crimes. Covertly trading with aliens refers to business interactions, or taking a barbarian's goods and giving them to barbarians. Calculate the value of the goods: one chi worth means indentured servitude for two and a half years. Apply an additional degree if it be three pi worth. Labor and exile will be applied if it be fifteen pi worth.


【疏】 議曰:越度緣邊關塞,將禁兵器私與化外人者,絞。共為婚姻者,流二千里。其化外人越度入境,與化內交易,得罪並與化內人越度、交易同,仍奏聽敕。出入國 境,非公使者不合,故但云「 越度」,不言「私度」。若私度交易,得罪皆同。未入者,謂禁兵器未入,減死三等,得徒二年半。未成者,謂婚姻未成,減流三等,得徒二年。因使者,謂因公使 入蕃,蕃人因使入國。私有交易者,謂市買博易,各計贓,準盜論,罪止流三千里。若私與禁兵器及為婚姻,律無別文,得罪並同「越度」、「私與禁兵器」、「共 為婚姻」之罪。

Anyone covertly providing contraband arms will suffer death by strangulation. Anyone marrying [with aliens] will be exiled two-thousand li. If they have not proceeded [past the border] or successfully [married], then reduce each sentence three degrees. If while on official state business there is covert trading, judgment is decided according to [the procedures for] theft.

Commentary: Those who trespass past the border garrisons and covertly provide contraband arms to aliens will suffer death by strangulation. Those who marry will be exiled two-thousand li. Those aliens trespassing into our borders past the garrisons and those engaging in trade here will be guilty of the same crimes as locals trespassing or engaging in trade. They may still petition for imperial permission. It is inappropriate to come and go over the border unless on diplomatic business, hence it just states “trespassing”. It does not state “covert crossing”. In the case of covert crossing and trading, they are guilty of the same crimes. “If they have not yer proceeded [past the border]” is where the contraband weapons have not yet been exported. Reduce by three degrees the death sentence. They will be subject to indentured servitude for two and a half years. “Not yet successfully [married]” refers to the act of marriage not being completed. Reduce by three degree the sentence of exile. They will be subject to indentured servitude for two years. Official state business refers those diplomats on official state business entering barbarian territories and those barbarians on official state business entering our country. “Covert trading” refers to trade in the market and business. For each case calculate the earnings and make judgement based on [the procedures for] theft. The crime will result in up to an exile of three-thousand li. In cases of covertly providing contraband arms and marriage where the law has no other articles, the crime incurred will be the same as those crimes for “trespassing”, “covertly providing contraband arms” and “marriage”.


Furthermore see the additional stipulation: “If barbarians wed Han women as wives or consorts, they may not return with them to barbarian territories.”


Furthermore see the procedure for host-guest relations: “When barbarian guests come to court nobody is to mingle with the guests on the road. The guest is also not to be permitted to speak with people. If provincial and district officials have no business, they also must not meet with the guest.” This where within the country ministers and commoners must not have contact with guests. The same above law applies to covert marriage. As such if barbarian comes to court and is permitted to reside they may marry wives and consorts. If they return to barbarian territories with them, then the punishment will be decided as a violation of an imperial decree.

The law codes of the early Tang were rather strict and the punishments severe, which perhaps reveals an anxiety about social disorder and a need for strong state control. The preceding Sui dynasty (581-618) had only lasted two emperors, and the previous period had been one of centuries long civil war, foreign invasions and social disorder since the fall of the Han dynasty in 220 CE, particularly in the Tang heartland of the north.

Judging from the language, I assume the 'barbarians' here primarily refers to the Tibetans. We need to bear in mind the Tibetans had attacked vassals of the Tang in 637 and 638. In 638 they camped on the border and demands for a royal princess were made. The Tibetan king Songtsän Gampo (Srong-btsan sGam-po) (d. 649) wed the Chinese princess Wencheng 文成公主 in 641. The Tang court had a perpetually uneasy relation with the Tibetans throughout its history and as such there was presumably much fear about border incidents as well as Tibetans acquiring Chinese arms and expertise. I would imagine one reason why Chinese subjects were forbidden from crossing the border was the fear that their advanced skills could be put to use by the hostile foreigners.

Centuries later the perception of strict officials was still present it seems. After the Japanese monk Ennin 圓仁 (794-864) arrived in China in 838, he was warned that the Tang officials were quite strict with their laws when he expressed his desire to remain behind in China without official permission while the diplomatic envoy he had accompanied returned to Japan.

The Tang was also noteworthy for its level of internal policing. Travelers required written permission to cross territories and they were constantly scrutinized, as was the case with Ennin who fortunately recorded many bureaucratic correspondences in his journal (see here).

For a good paper on early diplomacy and foreign policy in the Tang dynasty see "Ideas Concerning Diplomacy and Foreign Policy under the Tang Emperors Gaozu and Taizong" by Wang Zhenping in Asia Major (see here for the .pdf).