Li Gui (; died 619), courtesy name Chuze (), was the emperor of a short-lived state of Liang, which he established at the end of the Chinese Sui dynasty. He governed the parts of modern Gansu west of the Yellow River. In 618, he briefly considered submitting to Emperor Gaozu of Tang (Li Yuan), with whom they both believed he had a distant family relationship, but ultimately rejected the idea. In 619, the Tang dynasty official An Xinggui () pretended to submit to him, and then started an uprising at his capital Wuwei (武威, in modern Wuwei, Gansu), overthrowing him and turning him over to Emperor Gaozu, who executed him. As prince Li Gui was from Wuwei Commandery (武威, roughly modern Wuwei, Gansu), and he served as a militia officer in the local government. His family was said to be rich, and he used his wealth to help those who were poor, and thus gained a good reputation. He was also said to be well-read and capable in debating and logic. In summer 617, when Xue Ju rebelled against the Sui dynasty's rule at Jincheng (金城, in modern Lanzhou, Gansu), Li discussed with his associates Cao Zhen (), Guan Jin (), Liang Shuo (), Li Yun (), and An Xiuren () the possibility of also rebelling against Sui rule – under the reasoning that they were fearful that Xue would pillage Wuwei unless someone resisted, and the Sui officials were not capable of doing so. They resolved to do so, and when it came time to decide on a leader, Cao suggested that because prophecies had indicated that the next emperor would be named Li, that Li Gui should be their leader. In fall 617, Li had An gather the Xiongnu chiefs of the region, while he himself gathered the prominent families among the Han, and they rose together, arresting the Sui officials Xie Tongshi () and Wei Shizheng (). Li claimed himself the title of "the Great Prince of Liang west of the River," and adopted a governmental structure modelled after that of Sui's founder Emperor Wen. Guan proposed that the Sui officials be slaughtered and that their wealth be divided. Li responded: "You forced me to be leader, so you should listen to my orders. We rose in righteousness to save the people; if we murder for money, we are just bandits, and how can we achieve great