Exile (liu 流, also called fang 放, qian 遷, xi 徙, qianliu 遣流, liupei 流配 or peiliu 配流) was a common means of punishment in ancient China. Delinquents were sent to remote border regions, where they served in military garrisons in compulsory labour, or as soldiers. Reports about exile in the wilderness are found in the oldest history books. Tang the Perfect 成湯, for instance, vanquished King Jie 桀 of the Xia dynasty 夏 (21th - 17th cent. BCE), and sent him into exile in Nanchao 南巢, together with his consort Mo Xi 末喜. Yi Yin 伊尹, a regent of the early Shang dynasty 商 (17th-11th cent. BCE), sent King Tai Jia 太甲 (trad. r. 1753-1721) to Tonggong 桐宮 to repent his tyrannic behaviour. King Li 周厲王 (r. 878-841 BCE) of the Zhou dynasty 周 (11th cent.-221 BCE) was forced by his nobles into labour exile in Yi 彘.
During the Qin period 秦 (221-206 BCE) it was possible to commute corporal punishment, like cutting off a foot, into lifelong exile in the borderlands. In 239 BCE, when the Lord of Chang'an 長安君 rebelled against the king of Qin, his officers were executed, but his subjects sent to Lintao 臨洮 in the western mountains. Shortly later, the retainers of the traitor Lao Ai 嫪毐, more than 4,000 families, were exiled to Shu 蜀 (Sichuan).
In the penal code of the Northern Qi dynasty 北齊 (550-577), exile was for the first time counted to the five capital punishments (wuxing 五刑), along with beating with the light stick (chi 笞), beating with the heavy stick (zhang 杖), penal servitude (tu 徒), and the death penalty (si 死). In this canon, it was just second to the death penalty. The Northern Zhou 北周 (557-581) introduced five levels of punishment, with different distances from the capital city (Chang'an 長安, i.e. modern Xi'an 西安, Shaanxi): liu weifu 流衛服 (2,500 li 里, see weights and measures), liu yaofu 流要服 (3,000 li), liu huangfu 流荒服 (3,500 li), liu zhenfu 流鎮服 (4,000 li), and liu fanfu 流蕃服 (4,500 li). The longest period of exile lasted six years.
The Sui dynasty 隋 (581-618) reduced this pattern to three levels (san liu 三流), namely 1,000 li, 1,500 li, and 2,000 li, and the period of sentence ranged from 2 years to 3 years. The Tang dynasty 唐 (618-907) extended the distances by 1,000 li each, but reduced the time of exilation, with the shortest counting one full year of labour, mainly in military garrisons in the borderland (see penal military service chongjun 充軍, also called peili 配隸 or peijun 配軍). Persons serving extraordinarily for three years were called such with "increased labour exile" (jia yiliu 加役流). In some cases exiled persons accommodated and after having served their sentence, required to be registered in their "new home". This was called "permanent exile" (changliu 常流). In 632 Emperor Taizong 唐太宗 (r. 626-649) decreed that the death penalty could be commuted into increased labour exile. It was also possible to redeem (see redemption of punishments) the penalty of exile by donating copper to the authorities. This was allowed because the state needed copper for the production of coins. Exile in 2,000 li distance was redeemable by contributing 80 jin 斤 (see weights and measures) of copper, 2,500 li by 90 jin, and 3,000 li by 100 jin of copper.
The Song dynasty 宋 (960-1279) followed these regulations, but added to the punishment blows with the heavy stick: 17 blows on the back for 2,000 li, 18 for 2,500, and 20 for labour exile in 3,000 li. The penal code of the Yuan dynasty 元 (1279-1368) did not provide exile. The Ming 明 (1368-1644) and Qing 清 (1644-1911) dynasties raised the redemption sums (30, 33, and 36 strings of copper) as well as the number of blows, with 100 in all cases, because the length of exile was always 3 years.