Sima Yan, courtesy name Anshi, a native of Wen county in Henei commandery, was the founding emperor of the Jin dynasty, grandson of Sima Yi and son of Sima Zhao. In 265 he inherited his father's posts as chancellor and Prince of Jin, then at once forced the last Cao Wei ruler, Cao Huan, to abdicate, taking the throne himself and founding the Western Jin with its capital at Luoyang — Emperor Wu of Jin. In 280 the Jin armies advanced by six routes by land and water and destroyed Eastern Wu in a single stroke, ending the tripartite division of the Three Kingdoms and reuniting China. In the first years of unity he abolished the military-agricultural colonies, encouraged farming and mulberry cultivation, promulgated the household levy code, and lightened the people's burdens; the Taikang years brought social calm and economic recovery — the 'Taikang peace'. Yet he simultaneously enfeoffed the imperial princes as kings with military commands, hoping they would shield the throne, and named the feeble-minded Sima Zhong heir apparent — laying the fuse for the War of the Eight Princes. In his last years he grew indolent and extravagant, selling offices, and the court worsened. When Sima Yan died in 290, the unity of the Western Jin lasted barely two more decades before dissolving into civil war and foreign invasion.