Li Mi was a general of the Tang dynasty who in 754 led an army against the Nanzhao kingdom during the Tianbao War; the campaign ended in catastrophe, with the army destroyed by disease, hunger, and battle near the Erhai region and Li Mi himself dying in the rout. In a characteristic pattern of Bai benzhu religion, this defeated enemy commander was afterwards enshrined and venerated rather than reviled: at the General's Cave in the hills south-west of Xiaguan the Bai make regular offerings to him, both seeking his protection over the locality and appeasing the spirit of a man whose entire host perished on their soil. His cult exemplifies the benzhu principle whereby figures who died under extraordinary or violent circumstances are transformed into tutelary lords of the community.