The commandery (郡 in pinyin: jùn) was a historical administrative level of China. During the Zhou Dynasty (c. 1046–256 BCE), it was one level below a district (縣/县). Qin Shi Huang (r. 221–210 BCE), who unified the Warring States into one heavily-centralized empire, inverted the hierarchy and made commanderies higher than districts. During the Han Dynasty (202 BCE – 220 CE), the commandery became the core unit of local governmental administration, each commandery divided into counties. Whenever a subordinate and semi-autonomous kingdom was abolished, it was replaced by one or multiple commanderies under direct central government control. The Sui (581–618) and Tang (618–907) Dynasties abolished the commanderies and replaced them with zhou (州) or prefectures.