Huan Wen (桓溫) (312Huan Wen's biography in Book of Jin indicated that he was 62 (by East Asian reckoning) when he died. (锡文未及成而薨,时年六十二。) Jin Shu, vol.98. Thus by calculation, his birth year should be 312. – 18 August 373jihai day of the 7th month of the 1st year of the Ningkang era, per Emperor Xiaowu's biography in Book of Jin), courtesy name Yuanzi (元子), formally Duke Xuanwu of Nan Commandery (南郡宣武公), was a general and regent of the Jin dynasty (266–420), as well as the leader of the Huan clan of Qiao (谯国桓氏). He is commonly viewed as one of the greatest generals since Jin's loss of northern China, as he led the campaign that destroyed Cheng-Han and annexed its lands to Jin, and had some successes against the northern states Former Qin and Former Yan. After his death, the Huan clan would be entrenched in the Jin power structure for decades. After his son Huan Xuan temporarily usurped the Jin throne in 404 as the emperor of Chu (楚), he was posthumously honored as Emperor Xuanwu of Chu with the temple name of Taizu (太祖).

Early life and career Huan Wen was born in 312. His father Huan Yi (桓彝) was a commandery governor and a descendant of Eastern Han official Huan Rong.(桓彝,字茂伦,谯国龙亢人,汉五更荣之九世孙也。) Jin Shu, vol.74 (biography of Huan Yi). Huan Rong has a biography in vol.37 of Book of the Later Han. When he was young (less than a year old), his father once received a visit from Wen Jiao, who saw the infant boy and thought that the child was special. Huan Yi, because Wen had a high opinion of the child, thus named his son Wen, after Wen Jiao's family name. After knowing of the name, Wen Jiao laughed and said, "I'll have to change my surname in the future."(生未期而太原温峤见之,曰:“此儿有奇骨,可试使啼。”及闻其声,曰:“真英物也!”以峤所赏,故遂名之曰温。峤笑曰:“果尔,后将易吾姓也。”) Jin Shu, vol.98. Wen was referring to the practice of changing one's name to avoid naming taboos associated with emperors and highly respected persons.

In August 328,6th month of the 3rd year of the Xian'he era, per Emperor Cheng's biography in Book of Jin; the month corresponds to 24 Jul to 21 Aug 328 in the Julian calendar. Note that while Huan Wen's biography indicated that he was 15 (by East Asian reckoning) when his father died, he was actually already 16, if he was 61 when he died in Aug 373. during the rebellion of Su Jun, Huan Yi tried to resist Su's forces, but was defeated and killed by Su's general Han Huang, who received help from Huan Yi's subordinate Jiang Bo (江播). In 329, after Jiang had already died, Huan Wen killed Jiang's sons to avenge his father, and this was an act that brought him great fame. As he was considered capable, and his father had died for the imperial cause, he was selected as the husband for Emperor Cheng's sister Sima Xingnan (司馬興男) the Princess Nankang. He inherited his father's title of "Baron of Wanning", and he gradually rose in rank, eventually becoming the governor of Xu Province (徐州, modern central Jiangsu). Emperor Cheng's uncle Yu Yi (庾翼) was impressed with his talent, and often endorsed him for even greater responsibilities. During Emperor Kang's brief reign, Huan was one of the few officials who supported Yu's plan for a northern campaign against Later Zhao in 343, although Yu's plan was never actually carried out. After Yu's death in 345, the chancellor He Chong commissioned Huan to succeed Yu, as the commander of the military forces in the western provinces, even though some other imperial officials had misgivings about Huan's ambitions and independence.

Campaign against Cheng-Han

Soon after taking over from Yu, the ambitious Huan turned his attention west, wanting to destroy Cheng-Han, whose emperor Li Shi had mismanaged his state and lost the trust of his people. Most generals had concerns about the geographic barriers that isolated Cheng-Han (which occupied modern Sichuan and Chongqing) from Jin, and that Later Zhao might make a surprise attack if it realized that Jin's forces were attacking Cheng-Han. Late in 346, he launched the campaign. Li Shi sent his uncle Li Fu (李福), cousin Li Quan (李權), and Zan Jian (昝堅) to lead his forces to resist Huan, but Huan defeated Li Fu and then, abandoning most of his supplies and traveling light, quickly arrived in the vicinity of Cheng-Han's capital Chengdu. Zan Jian's forces, in fear, collapsed, instead of being able to regroup to try to save Chengdu.

However, Li Shi gathered the remaining troops and mounted a counterattack that was initially successful. Huan, in fear, ordered retreat—but his signal officer, in panic, beat his drums (signifying attack) rather than his gong (signifying retreat). The Jin forces attacked harder and defeated Cheng-Han forces, allowing Huan to march upon Chengdu's gates. Li Shi fled, but soon had a messenger submit a humble surrender petition to Huan. He then surrendered in person after binding himself and bringing a coffin—signifying readiness to be executed. Huan released him and escorted him to the Jin capital Jiankang, where Emperor Mu pardoned him and created him a marquess. To reward Huan, Emperor Mu created him the Duke of Linhe.

Mutual suspicion with imperial officials The victory over Cheng-Han, however, brought fear in imperial officials that the ambitious Huan intended to control the government. Emperor Mu's granduncle Sima Yu, Prince of Kuaiji, in order to counter Huan, invited a renowned official, Yin Hao, to join in major decision-making with him and Cai Mo. This brought a rivalry that Huan and Yin had since their youth into the open. The rivalry intensified after Yin seized more power late in 350 after accusing Cai of being disrespectful to the emperor and demoting Cai to commoner status.

Over the next few years, as Later Zhao collapsed in the midst of internecine wars between the emperor Shi Hu's sons and adoptive grandson Shi Min after Shi Hu's death in 349, Huan repeatedly requested the imperial government to authorize him to advance north to try to recover northern China for Jin, but he was repeatedly rebuffed, even after a campaign by Emperor Mu's maternal grandfather Chu Pou (褚裒) ended badly. Around the new year 352, Huan, upset that his requests were being repeatedly denied, 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 (Zouyu Fan, 騶虞幡) 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.

Yin, meanwhile, was preparing his own campaigns, and he launched one campaign in the middle of 352 and one late in 352—the second one being thoroughly disastrous, as he offended and intimidated the general Yao Xiang (姚襄) into rebellion, and was ambushed by Yao at great loss of life and materials. The people despised Yin for his military losses, and Huan submitted a petition demanding Yin's ouster. The imperial government was compelled to demote Yin to commoner status and exile him. From that point on, the imperial government largely no longer dared to deny Huan's requests.

Northern campaigns

Against Former Qin With Yin out of the picture, Huan launched a major attack against one of Later Zhao's successor states, Former Qin, in 354. His army defeated much of Former Qin's resistance, reaching all the way to the vicinity of Former Qin's capital Chang'an—but Huan hesitated at making one final assault against Chang'an. It was at this time that Huan met Wang Meng, who came to see him. Huan was impressed at Wang's knowledge and tactics, and he asked Wang why the people of the Qin lands were not shifting their allegiance to Jin, and Wang pointed out that the people were not sure what Huan's intentions were, given that he hesitated at crossing the Ba River (灞水), just east of Chang'an. As the situation stalemated, Huan began to run out of food supplies was forced to withdraw. He invited Wang to withdraw with him, but Wang declined, apparently believing that Huan was not the right person to follow.

Against Yao Xiang In 356, Huan submitted a petition requesting that the capital be moved back to Luoyang—the capital until its fall in 311 to Han-Zhao - but the imperial government declined, instead ordering him to first attack Yao Xiang, who had taken many cities in the Luoyang region after rebelling against Yin Hao earlier. Huan advanced his troops to Luoyang and faced Yao in battle, and he eluded a trap Yao laid for him and dealt Yao a major defeat, forcing Yao to head west. Huan secured the Luoyang region for Jin. He, in 362, again proposed the idea of moving the capital back to Luoyang, but the imperial government again declined.

Against Former Yan

For the next few years, Huan largely spent his effort in securing his power, as he invited many capable people to join his staff, including Xie An, Wang Tanzhi, Xi Chao, Wang Xun, and Xie Xuan. He did not carry out another northern campaign, apparently not willing to face the capable Former Yan general Murong Ke in battle. In 364, Emperor Ai, who succeeded Emperor Mu in 361, suffered a poisoning after taking pills given to him by magicians in search of immortality, and Huan was initially summoned to the capital to serve as regent, but a second order was then issued him cancelling that summon. Instead, he set up his base at Zheqi (赭圻, in modern Wuhu, Anhui) and monitored the situation at Jiankang remotely.

In 365, Murong Ke attacked Luoyang, and initially, Huan and Sima Yu were planning a counterattack to relieve Luoyang, but the plan was cancelled after Emperor Ai died in spring 365. Soon, Luoyang fell.

Late in 365, the Jin general Sima Xun, the governor of Liang Province (梁州, modern southern Shaanxi), who had participated in many campaigns, rebelled, and Huan commissioned one of his generals, Zhu Xu, to attack Sima. Sima was soon captured and killed.

After Murong Ke died in 367, Huan began to plan to attack Former Yan, whose regime was now largely in the hands of Murong Wei's granduncle Murong Ping the Prince of Shangyong, regarded as incompetent and corrupt, and Murong Wei's mother Empress Dowager Kezuhun. In 369, he launched the campaign, in conjunction with Xi Chao's father Xi Yin (郗愔), his brother Huan Chong, and Yuan Zhen, although he soon seized Xi Yin's troops and put them under his own command. Despite Xi Chao's advice that he head directly for Former Yan's capital Yecheng, Huan proceeded slowly, defeating Former Yan's troops repeatedly but taking three months to reach the Yellow River, stopping at Fangtou (枋頭, in modern Hebi, Henan) -- and again hesitated there at crossing the Yellow River and attacking Yecheng, not far away.

Murong Wei and Empress Dowager Kezuhun were panicking and planning to flee back to the old capital Helong (和龍, in modern Jinzhou, Liaoning), but Murong Wei's uncle Murong Chui the Prince of Wu offered to make one last attempt to resist Huan. Murong Chui and his brother Murong De engaged Huan, dealing him minor losses. Meanwhile, the Jin army's food supply was running out, as a supply plan that Huan put Yuan in charge of was failing in light of the failure to build a canal quickly. Huan began to withdraw, and Murong Chui and Murong De set up a trap for Huan's army, nearly annihilating it. Soon, Former Qin forces, from which Former Yan had sought assistance from, also arrived, and Huan was dealt another major defeat. Huan, humiliated at the greatest defeat in his career, deflected blame by accusing Yuan of being unable to supply food and ordered that Yuan be demoted to commoner status. Yuan, instead of submitting, occupied Shouchun (壽春, in modern Lu'an, Anhui) and rebelled, seeking assistance from both Former Yan and Former Qin.

Against Yuan Zhen's clan