Sima Daozi
Sima Yuanxian was the son of Sima Daozi the Prince of Kuaiji, the younger brother of Emperor Xiaowu and son of Emperor Jianwen, and he was born during the reign of his uncle Emperor Xiaowu. When Emperor Xiaowu was murdered by his concubine Honoured Lady Zhang in 396, he was succeeded by Emperor An, and Sima Daozi, as the emperor's uncle, became regent. Sima Daozi's trusted associates Wang Guobao () and Wang Xu (), because of their corrupt ways, quickly drew the ires of provincial officials Wang Gong () and Yin Zhongkan (), and in 397, Wang Gong and Yin started a rebellion, demanding that Wang Guobao and Wang Xu be killed. Sima Daozi, apprehensive of Wang Gong and Yin's power, executed Wang Guobao and Wang Xu, and Wang Gong and Yin withdrew. It was at this juncture that Sima Yuanxian, Sima Daozi's heir apparent, who was 15 but considered intelligent and capable, warned Sima Daozi that Wang Gong and Yin would one day again rebel. Sima Daozi, trusting his son, entrusted Sima Yuanxian with his personal guards.