[4] He was known in history as an erratic and wasteful ruler, whose actions greatly weakened the Northern Zhou regime.
After his death in June 580, the government was taken over by his father-in-law Yang Jian, who soon deposed his son Emperor Jing, ending the Northern Zhou and establishing the Sui dynasty.
It was around this time that it came to Emperor Wu's attention that most of Yuwen Yun's associates were men of low character.
At the suggestion of the superintendent of the crown prince's palace, Yuwen Xiaobo (宇文孝伯), Emperor Wu made Yuchi Yun (尉遲運), the well-regarded nephew of the general Yuchi Jiong (a cousin of Emperor Wu's), Yuwen Xiaobo's deputy.
He also chose a number of men whose characters he had high regard for to serve in other posts as the crown prince's assistance—but Yuwen Yun resented these personnel changes.
Historians also noted that Emperor Wu was very strict with the crown prince, treating him no easier than he did the officials.
Nevertheless, Wang Gui repeatedly suggested that Emperor Wu find a better heir, but Emperor Wu declined, because he believed his second son, Yuwen Zan (宇文贊) the Prince of Han to be even less competent than Yuwen Yun, and the other sons to be too young to be considered.
In summer 578, however, he grew ill suddenly while preparing a campaign against Tujue, and he, after entrusting the important matters to Yuwen Xiaobo, died.
Other than those proper acts, however, he began to carry out a number of inappropriate ones—including immediately promoting of Zheng Yi and having sexual relations with the ladies in waiting in his father's palace.
Emperor Xuan, in response, created his cousin (the daughter of his uncle Yuwen Zhao (宇文招) the Prince of Zhao) Princess Qianjin, offering to marry Princess Qianjin to Tuobo Khan, but with the demand that Tuobo Khan surrender Gao Shaoyi.
He disallowed officials from using belts or decorations for their clothing, and he forbade the use of such characters as "heaven" (天), "high" (高), "upper" (上), and "grand" (大), except by himself.
It was further recorded that whenever Emperor Xuan met with officials, he only discussed with them how to change customs or how to build palaces, disregarding the affairs of state.
Also around this time, when Yuchi Chifan the daughter-in-law of his cousin Yuwen Liang (宇文亮) the Duke of Qi was at the palace to greet him, he raped her.
He summoned his associates Liu Fang (劉昉) and Yan Zhiyi (顏之儀) to try to entrust the affairs to them, but when they arrived, he was already unable to speak.
Liu, after consulting with fellow attendants Zheng, Liu Qiu (柳裘), Wei Mo (韋謨), and Huangfu Ji (皇甫績), decided to summon Yang Jian to attend to Emperor Xuan and to serve as regent if Emperor Xuan should die—against Yan's attempt to have Yuwen Zhao made regent.
That night, Emperor Xuan died, and Yang seized the control of the palace and the imperial troops.
Within a year, Yang would seize the throne, ending Northern Zhou and establishing the Sui dynasty.