Emperor Wencheng of Northern Wei ((北)魏文成帝) (4 August 440 – 20 June 465), Han name Tuoba Jun (拓跋濬), Xianbei name Wulei (烏雷), was an emperor of the Xianbei-led Northern Wei dynasty of China. He became emperor aged 12 in the aftermath of the eunuch Zong Ai's assassinations of his grandfather Emperor Taiwu and uncle Tuoba Yu, and he was generally described by historians as a ruler who sought foremost to allow his people to rest after his grandfather's expansionist policies and extensive campaigns, and who also reformed the laws to become more lenient.
Tuoba Jun was born in 440, when his father Tuoba Huang was the crown prince of his grandfather, Emperor Taiwu. (Some historical sources give his birthdate as 448, a date that appears rather unlikely because that would make him only six years older than his son, Emperor Xianwen.) His mother, Consort Yujiulü, was the sister of the general Yujiulü Pi (郁久閭毗), who had been a member of the Rouran royal house but who had surrendered to Northern Wei. When he was little, he was much favored by his grandfather Emperor Taiwu, and often accompanied Emperor Taiwu, even on military campaigns. While he carried no official titles, he was known as the Prime Imperial Grandson (嫡皇孫). Around the new year 452, after his father Tuoba Huang had died in 451 after falling ill over his fear of false accusations by the eunuch Zong Ai, Emperor Taiwu created him the Prince of Gaoyang, but then reconsidered, believing that a princely title was inappropriate for his oldest grandson, and therefore cancelled the title—signifying strongly that he intended for Tuoba Jun to succeed him.
However, Zong Ai, in fear that Emperor Taiwu would punish him over his false accusations against Crown Prince Huang, assassinated Emperor Taiwu in spring 452, and, skipping over Tuoba Jun, made Tuoba Huang's younger brother Tuoba Yu the Prince of Nan'an emperor. Zong controlled all important matters of state, and when Tuoba Yu, displeased about Zong's arrogance, tried to strip him of power in fall 452, Zong assassinated him as well. The officials Dugu Ni (獨孤尼), Yuan He, Baba Kehou (拔拔渴侯), and Buliugu Li, however, then overthrew Zong and executed him, making Tuoba Jun emperor at the age of 12, as Emperor Wencheng.
Immediately following Emperor Wencheng's taking the throne, it appeared that the high-level officials began internecine struggles against each other, as for several years officials would be put into honored positions, only to be executed days or months later. These included senior officials held over from Emperor Taiwu's administration as well as those who had accomplished much in putting Emperor Wencheng on the throne, and included:
Tuoba Shoule (拓跋壽樂), chief commander (winter 452)
Baba Kehou, a major participant in the coup bringing Emperor Wencheng to the throne (winter 452)
Tuxi Bi (吐奚弼), prime minister under Tuoba Yu (winter 452)
Zhang Li (張黎), chief commander under Tuoba Yu (winter 452)
Tuoba Zhouniu (拓跋周忸) the Prince of Leling, chief commander (winter 452)
Duguhun Yuanbao (獨孤渾元寶) the Prince of Jingzhao (spring 453)
Tuoba Chong (拓跋崇) the Prince of Jianning, Emperor Wencheng's granduncle, and his son Tuoba Li (拓跋麗) the Prince of Ji'nan (spring 453)
Yujiulü Ruowen (郁久閭若文) the Prince of Puyang (fall 453)
Tuoba Ren (拓跋仁) the Prince of Yongchang, Emperor Wencheng's cousin (fall 453)
Tuoba Ba (拓跋拔) the Prince of Leping, Emperor Wencheng's cousin (spring 455)
It appeared that Yuan He and Buliugu Li were the key victors out of these struggles, for not only did they not suffer during the infighting, but became exceedingly honored late in Emperor Wencheng's reign. Both they and Dugu Ni were created princes. Whether Emperor Wencheng himself was involved in these internecine struggles is unclear, although the edicts were issued in his name. Yuchi Juan (尉遲眷), already a decorated general during Emperor Taiwu's reign, also became powerful.
Another characteristic of Emperor Wencheng's reign was that he often toured the provinces throughout his empire. He also frequently issued partial amnesties to the people of the capital Pingcheng.
In winter 452, Emperor Wencheng's mother Consort Yujiulü died, and he subsequently posthumously honored his parents as emperor and empress.
Around the new year 453, Emperor Wencheng, a Buddhist, officially ended the prohibitions against Buddhism that Emperor Taiwu had instituted in 445 (which became known as the first of Three Disasters of Wu), and he personally performed tonsure on five monks. However, as per the traditions instituted by Emperor Taiwu, he also publicly received Taoist amulets in spring 454.