Wan Yu's origins were not recorded in history. He served as the Prefect of Wucheng County during the reign of the third Wu emperor, Sun Xiu. During this time, he befriended Sun Hao, who was then the Marquis of Wucheng. Later, he was promoted to be a Left Ceremonial Officer. In 264, when Sun Xiu became critically ill, he entrusted his eldest son and heir apparentSun Wan to the care ofPuyang Xing, his Imperial Chancellor. After Sun Xiu's death, however, Puyang Xing did not assist the underage Sun Wan in becoming the new emperor. Around the time, as Eastern Wu faced several threats, the officials hoped for an older and more mature emperor to lead them. Wan Yu then used the opportunity to recommend Sun Hao to Puyang Xing and the general Zhang Bu – the regents in the interim period – to be the new emperor, in the hope that he would be rewarded later. He told Puyang Xing and Zhang Bu that Sun Hao was wise, decisive and similar to Sun Ce, and managed to persuade them to help Sun Hao. Puyang Xing and Zhang Bu, in turn, succeeded in convincing Sun Xiu's widow, Empress Zhu, to let Sun Hao inherit the throne. After ascending the throne, Sun Hao appointed Wan Yu as a Central Regular Mounted Attendant, along with Wang Fan, Lou Xuan and Guo Chuo. Later into his reign, Sun Hao turned out to be a cruel, extravagant and inept emperor, so Puyang Xing and Zhang Bu started regretting their decision to put him on the throne. When Wan Yu heard about their complaints, he secretly reported them to Sun Hao, who had them executed along with their families. Among his colleagues, Wan Yu got along well the most with Lou Xuan and the least with Wang Fan. He particularly detested Wang Fan as he believed that Wang Fan leveraged on his close relationship with Sun Hao to gain the emperor's favour. Wan Yu and another official, Chen Sheng, often slandered Wang Fan in front of Sun Hao. Over time, Sun Hao also gradually hated Wang Fan more and more because the latter often spoke up against his outrageous behaviour. Sun Hao finally found an excuse to execute Wang Fan in 266. In 266, Sun Hao split the office of Imperial Chancellor into two, and appointed Wan Yu as Right Imperial Chancellor and Lu Kai as Left Imperial Chancellor. The reason for splitting the office was that he wanted Wan Yu to balance against the influential and more senior Lu Kai. In the spring of 267, Sun Hao ordered Wan Yu to supervise military affairs in Jing Province and station at Baqiu, effectively replacing Lu Kai, who had been performing that task for years. In 268, Sun Hao decided to wage war against Eastern Wu's rival state, the Jin dynasty, so he ordered Wan Yu and Shi Ji to lead the Wu forces in Jing Province to attack the Jin dynasty. Wan Yu led troops to attack Xiangyang Commandery, but was defeated and driven back by the Jin general Hu Lie. After Lu Kai died in 269, Sun Hao summoned Wan Yu back to Jianye, the Wu imperial capital, in the following year. During this time, Wan Yu recommended Lou Xuan to serve as a Captain of the Imperial Guards. In the winter of 270/271, despite strong objections from his subjects, Sun Hao launched a military campaign against the Jin dynasty and set off from Niuzhu. Along the way, the Wu army encountered a snowstorm and could not advance. During this time, the Wu soldiers started grumbling and complaining; there was even talk among them about defecting to the Jin dynasty. Before Sun Hao ordered the troops to retreat back to Eastern Wu, Wan Yu had already secretly made arrangements with the generals Ding Feng and Liu Ping to return to Wu without informing the emperor. When Sun Hao found out, he was extremely furious but he did not immediately take action against them because the three of them held important positions in his government. After Ding Feng died of illness later that year, Sun Hao exiled his family to Linchuan. In the following year, Sun Hao secretly instructed a servant to serve poisoned wine to Wan Yu, but the servant added too little poison so Wan Yu survived. Nevertheless, upon realising that the emperor wanted him dead, Wan Yu took his own life. One month later, Liu Ping also died in distress and frustration. Sun Hao exiled Wan Yu's family to Luling Commandery.