安帝
In spring 404, Huan Xuan's general Liu Yu, seeing that Huan Xuan lacked actual talent or popular support, led an uprising of a coalition of generals against him, starting the uprising at Jingkou (京口, in modern Zhenjiang, Jiangsu) and reaching Jiankang within a few days. Huan Xuan fled, but took Emperor An and Sima Dewen with him, back to his old power base Jiangling (江陵, in modern Jingzhou, Hubei). Liu Yu declared the restoration of Jin, and by summer 404, forces under his confederates Liu Yi (), He Wuji (), and his brother Liu Daogui () had reached the vicinity of Jiangling and defeated Huan Xuan's troops. Huan Xuan tried to flee again, but was killed by forces of the general Mao Qu (). Emperor An was declared to be restored at Jiangling by the officials Wang Kangchan () and Wang Tengzhi (). However, Huan Xuan's nephew Huan Zhen () soon surprised Wang Kangchan and Wang Tengzhi and captured Jiangling, taking Emperor An hostage, although ostensibly honoring him as the emperor. In spring 405, Jiangling fell to Liu Yi's forces, and Huan Zhen fled. Emperor An was welcomed back to Jiankang, but at this point on, Liu Yu was largely in control of the situation.