commanderies, engulfed in agrarian rebellions, Emperor Yang went from Luoyang to Jiangdu (江都, in modern Yangzhou, Jiangsu), leaving Yang Dong in charge of Luoyang assisted by the officials Duan Da (), Yuan Wendu (), Wei Jin (), Huangfu Wuyi (), and Lu Chu (). The rebel leaders Li Mi and Zhai Rang soon took advantage of Emperor Yang's departure (along with the elite Xiaoguo Army (), to capture the food storages Luokou Storage () and Huiluo Storage (), near Luoyang, causing Luoyang to be down on food supplies. In spring 617, Yang Dong sent the generals Liu Changgong () and Pei Renji () against Li Mi and Zhai, but Liu and Pei were defeated. In summer 617, with his forces repeatedly defeated by Li Mi's, Yang Dong sent the official Yuan Shanda () to Jiangdu to seek aid from Emperor Yang, but Emperor Yang, believing in the prime minister Yu Shiji's assessments that the situation was not as severe as Yuan Shanda was claiming, initially refused to send aid. Pei soon surrendered to Li Mi, making Luoyang's position even more precarious. Emperor Yang finally did order the generals Pang Yu () and Huo Shiju () to lead the troops from the Chang'an region to aid Luoyang, and Pang and Huo were able to force Li Mi away from Huiluo, allowing Luoyang to regain some of its food supply, although by fall 617 Li Mi had recaptured Huiluo. In fall 617, Emperor Yang sent the general Wang Shichong (from Jiangdu) and several generals in other outlying areas to lead their troops to aid Luoyang. Wang was able to stem Li Mi's advances, and the armies stalemated. Meanwhile, the general Li Yuan had rebelled at Taiyuan and soon captured Chang'an, declaring Yang Dong's brother Yang You emperor (as Emperor Gong). In spring 618, Li Yuan sent his sons Li Jiancheng and Li Shimin to lead an army to Luoyang, ostensibly to aid it, but Yang Dong and his officials chose to have no communications at all with Li Jiancheng and Li Shimin. After Li Jiancheng and Li Shimin briefly engaged Li Mi, they considered the idea of attacking Luoyang but did not do so, and instead withdrew to Chang'an. In late spring 618, Emperor Yang was killed in a coup led by the general Yuwen Huaji, who declared Emperor Yang's nephew Yang Hao the Prince of Qin emperor, and began to lead