The extirpation of three generations (yi san zu 夷三族, san zu zhi zui 三族之罪, can yi zhi zhu 參夷之誅, pengzuo zuzhu 朋坐族誅, zuzhu 族誅, or shortly zu 族, during the Northern Wei period 北魏, 386-534, called fangmen zhi zhu 房門之誅), was a form of capital punishment invented by Qin dynasty 秦 (221-206 BCE), and demanding that along with the convict, also his relatives would be executed (yi 夷, zhu 誅). It is first mentioned in the history book Shiji 史記 (chapter Qin benji 秦本紀) from the mid-Western Han period 西漢 (206 BCE-8 CE), and is also explained in the treatise on penal law (Xingfa zhi 刑法志) in the dynastic history Hanshu 漢書. Zhang Yan 張晏 commented on the Shiji expression sanzu that it included the parents, brothers (and sisters? xiongdi 兄弟), wife and children of the convicted. Another early commentator, Ru Chun 如淳, explained that it meant just father, mother, and wife.
The sanzu punishment was the most notorious form of collective punishment or kin liability (see lianzuo 連坐, yuanzuo 緣坐). The punishment was first applied in 342, based on the harsh conception of criminal law as suggested by the legalist statesman Shang Yang 商鞅 (see the book Shangjunshu 商君書). The punishment is also mentioned and shortly characterized in the books Xunzi 荀子 (chapter Junzi 君子) and Mozi 墨子 (chapter Haoling 號令). The Hanshu chapters explains how the executions were carried out: The convicts were cut off their tongues, tattooed (on the forehead), cut off their noses and their feet, flogged to death, and their corpses mutilated and hung up on the market. The condemned were thus subject to the full range of the Five Corporal Punishments (wuxing 五刑). Interestingly enough, Shang Yang himself, charged with high treason, was condemned with exactly the sanzu punishment.
Yet it seems that this form of punishment was not really invented in the state of Qin, but also applied in the Western Zhou period 西周 (11th cent.-770 BCE). The "Book of Documents" Shangshu 尚書 (chapter Taishi 泰誓) speaks seven, nine, or even ten (groups of) persons to be executed together with the convict (qizu 七族, jiuzu 九族, shizu 十族). Yet while in the Qin law, zu clearly meant "generations", the word seems to have another meaning in the Shangshu context. It is known that the family of the failing assassin Jing Ke 荊軻, who had tried to murder the king of Qin, was punished in seven generations, from great-grandfathers to great-grandsons. The Suoyin commentary 索隱 to the Shiji explains the number seven in the following way: father, aunt/mother, sisters, grandsons, relatives of the mother, paternal cousins, and parents-in-law. In extreme cases, the whole village could be extinguished (yizong 夷宗, yixiang 夷鄉).
The punishment was abolished in the early Han under the reign of Emperor Wen 漢文帝 (r. 180-157 BCE). Emperor Cao Mao 曹髦 (r. 254-260 CE) of the Wei dynasty 曹魏 (220-265) revived the punishment in 255 CE to forestell rebellion and high treason. It was again formally abolished in 307, but re-introduced in 325, and only applied to male persons. The punishment was still in used (even if not included in law codexes) during the Song period 宋 (960-1279). Even the family of the Confucian scholar Fang Xiaoru 方孝儒 was during the Ming period 明 (1368-1644) punished in ten "generations", including his disciples.