In winter 417, Liu Yu, intent on wanting to seize the Jin throne, left Chang'an under the command of his 11-year-old son Liu Yizhen (劉義真), and while he left several able generals to assist Liu Yizhen, those generals soon conflicted with each other and were killing each other—and eventually, Liu Yizhen, believing that the main assistant whom Liu Yu had left him, Wang Xiu (王脩), was about to rebel, had Wang executed. Meanwhile, Helian Bobo sent his crown prince Helian Gui, another son Helian Chang, and Wang Maide to command armies south, not initially engaging Jin forces but isolating Chang'an from the rest of Jin territory—a task made easier when Liu Yizhen recalled Jin forces near Chang'an all to Chang'an. Liu Yu, hearing this, sent his general Zhu Lingshi (朱齡石) to replace Liu Yizhen and recalled Liu Yizhen, but as soon as Liu Yizhen and his troops left Chang'an, they were intercepted and crushed by Xia forces under Helian Gui. Liu Yizhen barely escaped, but the vast majority of the army was captured. Helian Bobo stacked the skulls of the Jin dead into a hill-like structure. Meanwhile, the people of Chang'an, who were angry that Liu Yizhen's forces pillaged the city before leaving, expelled Zhu, allowing Helian Bobo to enter Chang'an easily. Helian Bobo then claimed the title of emperor.