In 221 BCE, Emperor Qin Shi Huang ordered existing defensive walls built by the Warring States kingdoms linked into a continuous fortification spanning northern China. The project employed hundreds of thousands of conscripted laborers, soldiers, and convicts. Constructed primarily of rammed earth, the Qin-era wall stretched roughly 5,000 kilometers to defend against Xiongnu nomadic raids. Later dynasties, particularly the Han and Ming, extended and rebuilt sections. Total measured sections across all construction periods exceed 21,000 kilometers.