The Heishan bandits or Black Mountain bandits (Chinese: 黑山賊; pinyin: Hēishān zéi) was a bandit confederacy in the Taihang Mountain range during the later years of the Eastern Han Dynasty in China. They played a part in the internecine feuds that followed Han Dynasty's descent into chaos, and eventually surrendered to the warlord Cao Cao.
Following the loosening of central government control due to the repercussions of the Yellow Turban Rebellion, bandits and rebels sprung up everywhere. One such bandit group under Zhang Niujue (張牛角, aka Oxhorn Zhang), unrelated to the Yellow Turban movement, rose to power in the hill countries of the Taihang Mountains by plundering the western areas of the North China Plain. In 185, Zhang Niujue and fellow bandit Chu Yan (褚燕) joined forces to raid the town of Yingtao (癭陶). Zhang Niujue was killed in the skirmish, and his followers followed his last order to join Chu Yan. Chu Yan changed his surname to Zhang to honour his fallen colleague, so he became known as Zhang Yan. Soon, he became the nominal chief of all bandits east of the Taihang range, forming a confederacy of bandits known as the Heishan bandits. His ranks and files grew steadily in number until they were said to reach a million. They conducted raids in the commanderies of Changshan (常山), Zhao (趙), Zhongshan (中山), Shangdang (上黨) and Henei (河內). Unable to control the situation, the government accepted a nominal surrender and offered the bandits official positions. However, when the central government fell under Dong Zhuo's chaotic control in 189, the Heishan bandits went back to their former activities.
In the civil wars that followed the unsuccessful campaign against Dong Zhuo, Zhang Yan and the Heishan bandits apparently sided with Gongsun Zan and thus attacked commanderies that were in the possession of Gongsun Zan's enemies. In 191 the Heishan bandits raided Dong commandery (東郡), under the control of Yuan Shao's associate Cao Cao, but were driven back. Early in 193, the bandits and a contingent of the Southern Xiongnu under Yufuluo aided Yuan Shu in Chenliu (陳留), who was driven out of his original territory of Nanyang (南陽) by Yuan Shao's ally Liu Biao. As Chenliu was also within Cao Cao's territories, he swiftly defeated the allies and chased Yuan Shu away to the south. Later, the Heishan bandits under Yu Du (于毒), joined by local rebels, stormed Yuan Shao's Ye city, capital of Wei commandery (魏郡), and killed its Grand Administrator (太守) Li Cheng (栗成). This last attack drew Yuan Shao's furious retaliation, who led a suppression campaign to crush the bandits, slaying Yu Du and many other Heishan leaders, but Yuan Shao was ultimately unable to defeat Zhang Yan, who had the backing of various Xiongnu and Wuhuan groups. With heavy casualties on both sides, the opposing armies withdrew.