In September 265, Sima Zhao died and was succeeded as regent by his son
Sima Yan (Emperor Wu). In February 266, Sima Yan usurped the throne from Cao Huan, thus ending the Cao Wei state and establishing the
Jin dynasty. Throughout Emperor Wu's reign, Wei Guan continued to be an important official and general, serving in a variety of roles capably. As a result, one of his brothers and one of his sons were granted marquis titles. Wei Guan attempted to implement a revised civil service system, where the civil service examiner () would have less input on grading officials, and actual job performance would become more important, but while Emperor Wu liked Wei Guan's suggestions, he did not carry them out. In 271, Wei Guan was transferred to Senior General Who Attacks the North, where he was tasked with defending the northern frontier. During his tenure, the biggest threats to the frontier were the
Wuhuan in the east and the
Tuoba-
Xianbei people in the west. When the supreme chieftain of the Tuoba,
Tuoba Liwei sent his son and heir apparent,
Tuoba Shamohan to pay tribute, Wei Guan convinced Emperor Wu to detain Shamohan while he bribed the Tuoba and Wuhuan chiefs in a plan to sow division and weaken them. Shamohan was only allowed to return in 277, but he was soon killed in a conspiracy by the chiefs, throwing the Tuoba into a state of turmoil while the Wuhuan submitted to Jin. The following year, Wei Guan was summoned back to the capital. Wei Guan was one of the few officials who dared to openly speak to Emperor Wu about his choice of
heir apparent, his son
Sima Zhong, who was
developmentally disabled. On one occasion, Emperor Wu, after Wei Guan hinted that Sima Zhong should not be crown prince, sent a number of inquiries to Sima Zhong to have answered. When the inquiries were appropriately answered, Emperor Wu was happy and publicly showed Wei Guan the answers, embarrassing Wei Guan greatly and making it clear to other officials that Wei Guan had said something. After Emperor Wu's death in May 290,
Yang Jun, the father of
Empress Dowager Yang, assumed the regency for Sima Zhong, who ascended the throne as Emperor Hui. However, in April 291, Yang Jun was overthrown and killed in a coup started by Empress Jia. Wei Guan was then made regent, along with Emperor Hui's granduncle
Sima Liang in May. Wei Guan and Sima Liang tried to get the government on track, but Empress Jia continued to interfere with governmental matters. They also became concerned about the violent temper of Emperor Hui's half-brother
Sima Wei and therefore tried to strip him of his military command, but Sima Wei persuaded Empress Jia to let him keep his military command. Sima Wei's assistants Qi Sheng () and Gongsun Hong () thereafter falsely told Empress Jia that Sima Liang and Wei Guan planned to depose the emperor. Empress Jia, who had already resented Wei Guan for having, during Emperor Wu's reign, suggested that he change his choice of heir apparent, also wanted more direct control over the government, and therefore resolved to undergo a second coup. In summer 291, Empress Jia instructed Emperor Hui to write an imperial edict to Sima Wei, ordering him to have Sima Liang and Wei Guan removed from their offices. His forces thereby surrounded Sima Liang and Wei Guan's mansions, and while both men's subordinates recommended resistance, each declined and was captured. Against what the edict said, both were killed – Sima Liang with his heir Sima Ju () and Wei Guan with nine of his sons and grandsons. After Empress Jia, concerned about Sima Wei's power, then falsely declared that the edict was forged by Sima Wei and had him executed, Wei Guan was posthumously rehabilitated and restored to the status of a duke. == Calligraphy ==