The story is loosely based on historical events from the end of the 9th century in imperial China, when the Tang Dynasty court no longer had effective control of its empire. After Huang Chao's anti-government army sacked the national capital Chang'an, the Shatuo leader Li Keyong led his troops to suppress the rebellion. His 13 generals — essentially all sons or adopted sons — helped expel Huang from Chang'an, although a rift between some of them became more and more apparent in the process. Following the victory, Li accepted an invitation for a banquet at fellow military governor Zhu Wen's territory of Bianliang, unaware that it was a trap to assassinate him.