Sima Yao was born in 362, when his father was the Prince of Kuaiji and the prime minister for his grandnephew . His mother, was originally a servant involved in textile production, but based on a magician's words that she would bear his heir , Sima Yu took her as his concubine, and she gave birth to Sima Yao. As he was born at dawn, she named him Yao, with the courtesy name Changming, both meaning "dawn." A year later she would give birth to his brother Sima Daozi. As the oldest surviving son of Sima Yu, Sima Yao was designated as the heir apparent early in his life, and in 365, when he was just three years old, offered the greater title of Prince of Langye to his father and the title of Prince of Kuaiji to him. Sima Yu declined, both personally and on his son's behalf, and Emperor Fei did not insist on them taking on the greater titles.
In 371, having lost a devastating battle to the Former Yan general Murong Chui in 369, the paramount general Huan Wen decided to display his power by falsely accusing Emperor Fei of and not being the actual father of his sons, and then deposing him. He made Sima Yu the new emperor , although actual power was in his own hands, as he considered usurping the Jin throne. In 372, as Emperor Jianwen grew ill, he created Sima Yao crown prince, but in his will initially offered the throne to Huan Wen if he wanted it, until his official Wang Tanzhi objected and authored, with his approval, an amendment whereas Huan was only compared to Zhuge Liang and Wang Dao. Nevertheless, after Emperor Jianwen then died, many officials, apprehensive of Huan, were not immediately willing to declare Crown Prince Yao the new emperor -- wanting to wait to see Huan's signal. At the instigation of Wang Biaozhi , however, Crown Prince Yao took the throne as Emperor Xiaowu.
As the new emperor was only 10 years old, his cousin 's wife served as regent, but the decisions were actuallyl being made by Xie An and Wang Tanzhi, as Huan, apparently fearful of being entraped, declined an offer to be regent. However, there would continue to be fears that Huan was about to seize the throne, and in 373, when Huan finally visited the capital Jiankang, it was rumored that Huan would execute Wang and Xie and seize the throne. However, Huan hesitated and did not do so, and after he died later that year, the fears of a Huan usurpation dissipated, as his brother and successor Huan Chong was committed to the survival of the imperial government.
A major issue for the Jin government early in Emperor Xiaowu's reign was the continued military pressure exerted by the powerful northern rival, Former Qin. In 373, Former Qin would attack and seize Jin's Liang and Yi Provinces. Internally, however, Jin was apparently well-governoed by Xie and Huan Chong.
In 375, Emperor Xiaowu married , the daughter of the official Wang Yun as his empress. He was 13 and she was 16. He also started studying the Chinese classic texts and writing poetry. In 376, Empress Dowager Chu officially removed herself from the regent position and returned her powers to Emperor Xiaowu, although the decisions were still largely being made by Xie.
In 376, the Jin vassal Former Liang was attacked by Former Qin, and Jin forces, under Huan Chong's command, attempted to try to relieve the pressure on Former Liang by attacking Former Qin, but Former Liang fell quickly, and Huan withdrew his forces. In apprehension of a Former Qin attack, Jin evacuated much of its population north of the Huai River to regions south of the Huai River.
In 378, Former Qin made major attacks against the important Jin cities of Xiangyang, Weixing , and Pengcheng. While the general Xie Xuan was able to immediately recapture Pengcheng after it fell, Xiangyang and Weixing were taken by Former Qin forces in 379.
In 380, Empress Wang died. Emperor Xiaowu would not have another empress for the rest of his life.
In 381, Emperor Xiaowu began to study Buddhist sutras, and he established a Buddhist study hall inside his palace, inviting monks to live within.
In 383, Huan Chong made a counterattack against Former Qin, hoping to recapture Xiangyang and the southwest. However, after some initial losses, Huan abandoned the campaign.
The Battle of Fei River
Later in 383, Former Qin's emperor Fu Jiān launched a major attack against Jin, intending to destroy it and unite China. At the Battle of Fei River, however, his forces panicked after trying to retreat to draw Jin forces across the Fei River, and it collapsed with great losses, including his brother and prime minister Fu Rong. Former Qin would start collapsing in 384 after its defeat, and would not again pose a threat to Jin.
After defeating Former Qin forces, in light of Former Qin's collapse, Xie Xuan spearheaded a campaign to regain lost territory, and Jin captured most of the Former Qin provinces south of the Yellow River in fairly rapid succession, as well as regaining Liang and Yi Provinces. The prime minister Xie An, however, whom most credited with the victory, began to lose favor in Emperor Xiaowu's eyes, as Xie's son-in-law Wang Guobao , unhappy that Xie did not give him important posts, began to flatter both Emperor Xiaowu and his brother Sima Daozi the Prince of Kuaiji and attack Xie. Xie remained prime minister, however, until his death in 385. He was replaced by Sima Daozi. Both Emperor Xiaowu and Sima Daozi became obsessed with feasting and drinking, and neither spent great amount of time on affairs of state.
In 387, Emperor Xiaowu created his oldest son, five-year-old , crown prince, notwithstanding the fact that Sima Dezong was -- so severely that even after he grew older, he was described of not being able to talk or dress himself, and not even being able to tell whether he was full or hungry while eating.
In 390, as Emperor Xiaowu began to tire of how Sima Daozi was taking his favors for granted and being disrespectful, decided to try to look for counterbalancing forces. He decided to make the officials Wang Gong and Yin Zhongkan key regional governors, despite warnings that both Wang and Yin were talented but narrow-minded and might create issues later.
In 394, Emperor Xiaowu honored his mother Consort Li as empress dowager.
By 395, the conflict between Emperor Xiaowu and Sima Daozi had flaired into the open, but because of the intercession of Empress Dowager Li, Emperor Xiaowu did not remove his brother. After further mediation by Xu Miao , the relationship between the brothers seemed to be restored.
By 396, Emperor Xiaowu was spending so much of his time in drinking and women that he was not seeing his officials on important matters of state on a regular basis. His favorite consort was the beautiful Consort Zhang. In late fall 396, at a feast, Emperor Xiaowu joked at her, who was then almost 30 years old, "Based on your age, you should yield your position. I want someone younger." She was very inflamed, but hid her emotions. That night, after Emperor Xiaowu again fell drunk, she ordered all the eunuchs away, bribing them with wine, and then ordered her servant girls to suffocate Emperor Xiaowu by putting a blanket over his face. She then further bribed many attendants and claimed that the emperor died suddenly in his sleep. Because Sima Daozong the crown prince was developmentally disabled, and Sima Daozi was foolish and unthinking, no one investigated the death of the emperor. The next day, Sima Daozong assumed the throne as Emperor An, with Sima Daozi as regent.
* ''Ningkang'' February 19, 373-February 8, 376
* ''Taiyuan'' February 9 376-February 12, 397
** Emperor Jianwen of Jin
** Empress Wang Fahui
* Major Concubines
** Consort Chen Guinü, mother of Crown Prince Dezong and Prince Dewen
** Consort Xu, mother of Princess Xin'an
** Consort Zhang
** Sima Dezong , the Crown Prince , later Emperor An of Jin
** Sima Dewen , the Prince of Langye , later Emperor Gong of Jin
** Princess Jinling
** Pirncess Xin'an
** Princess Poyang