Ziying 子嬰 (d. 206), King of Qin 秦, was the last ruler of the Qin dynasty 秦 (221-206 BCE), whose king Ying Zheng 嬴政 had proclaimed himself as the First Emperor of Qin 秦始皇帝 (r. 246-210 BCE).
After the death of the First Emperor, the powerful eunuch Zhao Gao 趙高 and the Counsellor-in-chief, Li Si 李斯, machinated the accession to the throne of Prince Huhai 胡亥. They forged an edict of the late emperor to the Heir Apparent, Prince Fusu 扶蘇, to kill himself. The Prince obeyed, and Huhai became the Second Emperor of Qin 秦二世皇 (r. 209-207). Huhai at first obeyed all the plans of the powerful eunuch, but when the latter eliminated Li Si and widespread peasant rebellions broke out, Zhao Gao killed Huhai.
The eunuch therupon enthroned a Prince Ziying. The latter was either a nephew or a cousin of the Second Emperor or a younger brother of the First Emperor. Ziying had formerly vehemently criticized the Second Emperor for his blind trust into Zhao Gao and his brutal murdering of competent officials, like the relatives of general Meng Tian 蒙恬 (d. 210 BCE). On his accession to the throne in 207, Ziying renounced the title of emperor and expressed his contentedness with the title of King of Qin. Ziying knew some eunuchs he could trust, like Han Tan 韓談, and managed to have Zhao Gao killed.
He was only king for 46 days at the time when the army of the rebel leader Liu Bang 劉邦 (d. 195 BCE), the eventual founder of the Han dynasty 漢 (206 BCE-220 CE), reached the capital Xianyang 咸陽 (modern Xianyang, Shaanxi). Known that the dynasty's fate came to a close, Ziying rushed out the city to welcome Liu Bang and presented him the state seals and submitted to the rebel army. Liu Bang accepted Ziying's surrender.
Yet when the hegemonial king Xiang Yu 項羽 (233-202 BCE) arrived in Xiangyang, he killed Ziying and extirpated the house of Qin.