Sima Yu was born in 320, as the youngest son of , by his favorite concubine Consort Zheng Achun . As Emperor Yuan's wife Yu Mengmu had died years earlier , and the mother of his oldest son the Crown Prince , Lady Xun, had been forced to leave the palace due to Princess Yu's jealousy while she was still alive, Consort Zheng was effectively the mistress of the palace, although she never carried the title of empress. In 322, Emperor Yuan created him the Prince of Langye -- the same title that Emperor Yuan had earlier, which was therefore considered a special honor.
In 323, Emperor Yuan died. In 326, Consort Zheng also died, and because, as Prince of Langye, Sima Yu was not permitted by law to mourn his mother, he, at age six, requested another title by which he could. His nephew , himself then a young child, permitted it, and created him the Prince of Kuaiji. As he grew in age, he was given a progression of higher and higher posts, although without actual power.
During Emperor Mu's reign
In 344, another nephew of Sima Yu, , died, and was succeeded by his infant son . Emperor Mu's mother became regent, but she largely followed the advice of prime minister He Chong . As it was customary, at this point of Jin history, for there to be two prime ministers, He Chong recommended Empress Dowager Chu's father Chu Pou , who declined and recommended Sima Yu instead. He Chong and Sima Yu thus shared the prime minister responsibilities until He Chong's death in 346. He Chong was replaced by Cai Mo .
In 347, after the ambitious general Huan Wen, without the imperial government's approval, carried out a campaign against and destroyed Cheng Han, annexing Cheng Han territory to Jin, the imperial government became apprehensive that Huan would use this opportunity to take over. Sima Yu thus invited the official Yin Hao, who was considered able, to join him and Cai in making important decisions, to counter Huan's influence. In 350, after Cai had repeatedly declined greater honor conferred him by the emperor, Yin accused Cai of disrespecting imperial authority and had him removed, seizing more power than he had before.
In 348, Sima Yu's heir apparent Sima Daosheng , who was described as careless and frivolous, was accused of unspecified crimes, and he was deposed and imprisoned, and died in imprisonment. Sima Yu's wife and Sima Daosheng's mother, Princess Wang Jianji , also died in distress. His other sons, one by Princess Wang and three by various concubines, died early, and he was left without an heir, and his concubines were not conceiving any more. He retained a magician to look at his concubines to see which one could conceive an heir, and the magician looked at all of them and opined that none was destined to give him an heir -- but then he saw a dark-skinned maid who was working with textiles, who was derogatorily referred to as a , named , and he, in surprised, yelled out, "She is the one!" Sima Yu therefore took her as a concubine, and she bore him two sons -- in 352 and Sima Daozi in 353. Sima Yao was subsequently named heir apparent.
Around the new year 352, Huan, impatient after his requests to advance north in light of Later Zhao's collapse were being rebuffed by Sima Yu and Yin, who were concerned about his expanding power, and mobilized his troops and gestured as if he were about to attack the capital. Yin was shocked, and initially considered either resigning or send the imperial banner of peace to order Huan to stop. After advice from Wang Biaozhi , however, he instead asked Sima Yu to write a carefully worded letter to Huan, persuading Huan to stop.
After Yin himself launched unsuccessful northern campaigns in 352 and 353 -- the latter at great loss of life and property -- Huan submitted a petition accusing Yin of crimes. The imperial government, led by Sima Yu, felt compelled to depose Yin in 354. From that point on, Sima Yu became the sole prime minister, although he was often forced to submit to Huan's wishes on important matters. Later in 354, Huan himself launched a campaign north against Former Qin, one of the successor states to Later Zhao, but after initial successes, he was forced to withdraw as he hesitated at attacking Former Qin's capital Chang'an and ran out of food supplies.
In 358, Sima Yu offered to resign and return all authority to Emperor Mu. Emperor Mu declined.
In 361, Emperor Mu died without a son, and by order of Empress Dowager Chu, his cousin the Prince of Langye ascended the throne as Emperor Ai. Sima Yu continued in his post as prime minister.
During Emperor Ai's reign
In 363, when Emperor Ai's mother died, Sima Yu served as regent for the three-month mourning period.
In 364, Emperor Ai, who was obsessed with immortality, was poisoned by pills given him by magicians, and he could not handle important affairs of state. Empress Dowager Chu again served as regent, but important decisions were made by Sima Yu and Huan Wen. In 365, with the Former Yan regent Murong Ke sieging the important city Luoyang, Sima Yu and Huan discussed launching a counterattack to relieve Luoyang, but when Emperor Ai died in spring 365, the plans were cancelled. Emperor Ai was succeeded by his brother the Prince of Langye, who took the throne as Emperor Fei. Sima Yu continued in his role as prime minister.
During Emperor Fei's reign
In late 365, Emperor Fei offered the title Prince of Langye to Sima Yu and further created his heir apparent Sima Yao the Prince of Kuaiji. Sima Yu declined on his son's behalf and further himself declined the title of Prince of Langye, continuing to refer to himself as the Prince of Kuaiji, and Emperor Fei did not insist on his taking the greater title.
In 369, after Huan Wen launched a major attack against Former Yan but suffered a devastating defeat at the hands of Murong Chui, he considered another way to showcase his power. He decided to depose Emperor Fei, and he spread false rumors that Emperor Fei was and that his sons were actually sons of men that he favored . In winter 371, Huan forced Empress Dowager Chu to issue an edict deposing Emperor Fei and replacing him with Sima Yu, who took the throne with trepidation but felt he had no choice.
An immediate issue that Emperor Jianwen had to deal with upon taking the throne was Huan's suspicions toward his older brother Sima Xi the Prince of Wuling, whose interest in military matters made Huan concerned that he would oppose Huan. Huan therefore falsely accused him of plotting treason, and Emperor Jianwen agreed to remove Sima Xi from his posts. Subsequently, however, Huan manufactured evidence against Sima Xi and petitioned that he be put to death. Emperor Jianwen wrote to Huan, stating that he did not want to kill his brother -- and that if he was forced to, he would instead yield the throne. Huan, not willing to risk a confrontation, settled for having Sima Xi and his sons demoted to commoner status and exiled.
In summer 372, Emperor Jianwen grew ill, and repeatedly tried to summon Huan to the capital -- perhaps to offer him the throne -- but Huan, concerned that it was a trap, continuously declined. Emperor Jianwen soon died, and was succeeded by his 10-year-old son Sima Yao, whom he created crown prince right before his death. As Huan himself died in early 373, the threats of a Huan usurpation dissipated, and Jin continued for several decades longer.
* ''Xian'an'' 371-372
** Emperor Yuan of Jin
** Consort Zheng Achun , posthumoustly honored as Empress Dowager Xuan
** Princess Wang Jianji , daughter of Wang Xia , posthumously honored as Empress Jianwenxun, mother of Heir Apparent Daosheng and Sima Yusheng
* Major Concubines
** Consort Hu, mother of Sima Yu and Sima Zhusheng
** Consort Wang, mother of Sima Tianliu
** , mother of Crown Prince Yao, Prince Daozi, and Princess Poyang
** Consort Xu, mother of Princess Xin'an
** Sima Daosheng , Si
** Sima Yusheng , died early
** Sima Yu , died early, posthumously created Prince Xian of Linchuan
** Sima Zhusheng , died early
** Sima Tianliu , died early
** Sima Yao , the Crown Prince , later Emperor Xiaowu of Jin
** Sima Daozi , initially the Prince of Langye , later the Prince Wenxiao of Kuaiji
** Sima Daofu , the Princess Xin'an
** Princess Wuchang
** Princess Xunyang