Emperor An of Jin

With the warlord Liu Yu as the actual power, Jin destroyed Southern Yan and Later Qin, greatly expanding its territory.

However, with Liu Yu up in the north, the renegade governor of Guang Province (廣州, modern Guangdong and Guangxi), Lu Xun (卢循; descendant of Lu Zhi), rebelled and threatened the capital city Jiankang, before Liu Yu returned and crushed the revolt.

Sima Dezong was the oldest son of Emperor Xiaowu, born of his concubine Consort Chen Guinü in 382.

When Sima Daozi awoke from his stupor, he was enraged, but after that point his power became extremely limited, even though he nominally remained regent.

Sima Yuanxian's regency was one in which he became surrounded by flatterers, and he began to have unrealistic ambitions of ending the threat that various provincial warlords posed to his rule.

While he appeared to have some abilities, he also was, according to traditional historians, wasting the government's money in luxury and not paying attention to the burdens of the people.

However, Huan Xuan soon took to living luxuriously and modifying laws at whim, and it was said that supplies to the imperial household were so reduced that even Emperor An almost suffered from hunger and cold.

In fall 403, Huan Xuan had Emperor An create him the Prince of Chu and give him the nine bestowments—both signs of an impending usurpation.

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).

Emperor An was welcomed back to Jiankang, but at this point on, Liu Yu was largely in control of the situation.

For the next few years, he also made several offers to resign his posts, judging correctly that the imperial officials would not dare to accept them, to further establish the image that he was indispensable.

In spring 405, Mao Qu's soldiers, from Yi Province (modern Sichuan and Chongqing), unhappy that Mao sent them on long-distance campaigns initially against Huan Xuan and then against Huan Zhen, rebelled, supporting the military officer Qiao Zong as their leader.

Also in 405, Lu Xun, who had in 404 marched south and captured Panyu (番禺, in modern Guangzhou, Guangdong) during the wars relating to Huan Xuan, offered peace to the imperial government by paying a tribute.

In 409, the Southern Yan emperor Murong Chao began a campaign of attacking and pillaging the Jin northern borders, intending to capture men and women to be trained as musicians.

In spring 410, Liu Yu, captured Guanggu, ending Southern Yan, and considered further readying a campaign against Later Qin, was informed that Lu and Xu were attacking north, and therefore quickly returned south toward Jiankang.

A number of imperial officials, including Meng, suggested that Emperor An be taken across the Yangtze River to evade Lu's forces, but Liu Yu refused, choosing to defend Jiankang.

Liu Yu gave chase, but also ordered his generals Sun Chu (孫處) and Shen Tianzi (沈田子) to take a fleet by sea to attack Panyu, fully confident that he can defeat Lu and make it impossible for Lu to then retreat to his home base.

With the state having been stabilized after Lu Xun's destruction, Liu Yu again turned his attention outward, hoping to use military victories to propel himself into sufficiently high public standing that he can take the throne for himself.

Meanwhile, in late 412, Liu Yu commissioned the general Zhu Lingshi (朱齡石) to attack Qiao Zong's Western Shu, secretly instructing him to take the long route to Qiao Zong's capital Chengdu by Min River (岷江), rather than the short route by Fu River (涪江).

In 414, Liu Yu began to suspect Liu Yi's replacement as the governor of Jing Province, Sima Xiuzhi (司馬休之), who was a member of the imperial clan and whose son Sima Wensi (司馬文思) had been created the Prince of Qiao and had gathered many adventurers around him.

In winter 416, the important city Luoyang fell to Liu Yu's general Tan Daoji (檀道濟).

Liu Yu's fleet, commanded by Wang Zhen'e (王鎮惡, Wang Meng's grandson), advanced quickly, while Yao Hong tried to first destroy Liu Yu's flank forces, commanded by Shen Linzi's brother Shen Tianzi.

Despite Yao Hong's large advantage in numbers, Shen Tianzi crushed him, forcing him to flee back to his capital Chang'an.

Wang Zhen'e's fleet then arrived and defeated Later Qin's final resistance, entering Chang'an.