Under Later Liang and Duan Ye
Juqu Mengxun was born in 368, while the area that would later be his domain was under the rule of Former Liang, but little is known about his early years. He was of Xiongnu ancestry, and it was said that his ancestors served as the left Juqu (an office title of unclear responsibility) for Xiongnu Chanyus, and so they started using Juqu as the family name. Later, during Former Qin and Later Liang rule, Juqu Mengxun became known for broad knowledge in history and military tactics and thought to be both humorous and full of strategies, and became feared by the Former Qin governor Liang Xi (梁熙) and the Later Liang emperor Lü Guang, and so he tried to divert attention from himself by drinking heavily and spending time on frivolous matters.
In 397, Lü Guang sent his brother Lü Yan (呂延) on an attack against Western Qin, but Lü Yan was killed in a trap set by the Western Qin prince Qifu Gangui. Juqu Mengxun's uncles Juqu Luochou (沮渠羅仇) and Juqu Quzhou (沮渠麴粥) were Lü Yan's assistants, and in light of Lü Yan's death, Lü Guang believed false accusations against them and executed them. Juqu Mengxun escorted their caskets back to their home territory of Zhangye (張掖, in modern Zhangye, Gansu) and then persuaded the various Xiongnu tribes to rise against Later Liang. Initially, he was defeated by Lü Guang's son Lü Zuan and fled into the mountains, but he was soon joined in rebellion by his cousin Juqu Nancheng (沮渠男成), who sieged Jiankang (建康, also in modern Zhangye) and persuaded Duan Ye the governor of Jiankang Commandery to accept leadership of the rebels, establishing Northern Liang. Soon, Lü Guang came under the greater threat of a rebellion by Guo Nen (郭黁) and recalled Lü Zuan to face that threat, and Duan Ye's nascent state survived. Juqu Mengxun joined Duan Ye, and was made a major general of the state. In 398, Duan Ye sent him on an expedition against Lü Guang's nephew Lü Chun (呂純), and Juqu Mengxun captured Lü Chun, causing all remaining Later Liang cities west of Zhangye to submit to Northern Liang, further enlarging Northern Liang territory. Duan Ye therefore created Juqu Mengxun the Marquess of Linchi. Lü Guang's son Lü Hong (呂弘) soon abandoned Zhangye, and Duan Ye moved his capital to Zhangye, and tried to further pursue Lü Hong against Juqu Mengxun's advice. Lü Hong defeated him and nearly killed him, but Juqu Mengxun saved Duan Ye. In 399, when Duan Ye claimed the title of Prince of Liang, he made Juqu Mengxun one of his two prime ministers, sharing responsibilities with Liang Zhongyong (梁中庸). Later that year, when Northern Liang was under attack by Lü Guang's crown prince Lü Shao and Lü Zuan, it was at Juqu Mengxun's suggestion that Duan Ye refused to engage, forcing Lü Shao and Lü Zuan to retreat when Southern Liang relief forces under Tufa Lilugu arrived. In 400, when the general Wang De (王德) rebelled, Duan Ye sent Juqu Mengxun to attack him, and Juqu Mengxun defeated him and, while he fled, captured his wife and children.
By 401, however, Duan Ye was heavily apprehensive of Juqu Mengxun's strategies and abilities, and he considered sending Juqu Mengxun far away. Juqu Mengxun, knowing Duan Ye's suspicions, tried to hide his ambitions. However, at the same time, because he was often insulted by another official that Duan Ye heavily relied on, Ma Quan (馬權), he falsely accused Ma of treason, and Duan Ye killed Ma. Juqu Mengxun then told Juqu Nancheng that he felt that Duan Ye lacked abilities and was an inappropriate ruler, trying to persuade Juqu Nancheng to rise against Duan Ye. When Juqu Nancheng refused, Juqu Mengxun requested to leave the capital to be the governor of Xi'an Commandery (西安, also in modern Zhangye), and Duan Ye agreed. Juqu Mengxun then set a trap for both Juqu Nancheng and Duan Ye—he made an appointment with Juqu Nancheng to offer sacrifices to the god of Lanmen Mountain (蘭門山, near Zhangye) on a vacation day, but submitting a false report through the official Xu Xian (許咸) that Juqu Nancheng was set to rebel and would start the rebellion on a day that he requested permission to sacrifice to the god of Lanmen Mountain. When Juqu Nancheng requested Duan Ye for such permission, Duan Ye arrested him and ordered him to commit suicide. Juqu Nancheng, who had realized Juqu Mengxun's plan by this point, told Duan Ye that this was a sign that Juqu Mengxun was about to rebel and that he should keep Juqu Nancheng alive, and then when Juqu Mengxun rebels he could counterattack. Duan Ye, not believing in Juqu Nancheng, executed him. Juqu Mengxun then cited Duan Ye's execution of Juqu Nancheng to ask his people to rise against Duan Ye, and the people indeed rose in rebellion, because of the high regard they had for Juqu Nancheng. The rebels quickly arrived at Zhangye, and it fell. Despite Duan Ye's pleas, Juqu Mengxun executed him. The Northern Liang officials all endorsed Juqu Mengxun to take over the throne, and he took throne with the title Duke of Zhangye.
Read more about this topic: Juqu Mengxun