Wei Guan was from Anyi County, Hedong Commandery, which is located west of present-day Xia County, Shanxi. His father Wei Ji was a high-ranking Wei official and marquis, who died in 229. Wei Guan inherited his father's peerage, and when he grew older became an official. Throughout the years, he became known for his capability and was continuously promoted. After Cao Huan became emperor, he became an Official of Justice, and was known for his strength in logical thinking. When the Wei regent Sima Zhao ordered the generals Zhong Hui and Deng Ai to attack Wei's rival state Shu Han in 263, Wei Guan served as Deng Ai's deputy. After the fall of Shu that year, Zhong Hui planned a rebellion, and the first step of his preparation was to falsely accuse Deng Ai of treason. Sima Zhao, believing Zhong Hui's accusations, ordered Deng Ai arrested, and Zhong Hui in turn ordered Wei Guan to arrest Deng Ai, hoping that Wei Guan would fail and be killed by Deng Ai so that he could further affirm his accusations against Deng Ai. Wei Guan knew this, so he surprised Deng Ai in the middle of the night and arrested him. When Zhong Hui rebelled later, Wei Guan pretended to be seriously ill, so Zhong Hui lowered his guard against Wei Guan. Later, Wei Guan participated in inciting the soldiers to start a mutiny against Zhong Hui and end the rebellion. Fearful that Deng Ai would then retaliate against him, he had Deng Ai tracked down and killed. When Du Yu publicly denounced Wei Guan, instead of becoming angry and retaliate against Du Yu, Wei Guan visited him and apologised. He also declined a larger fief that Sima Zhao was ready to bestow on him for his accomplishments.
Career during the Jin dynasty
In 265, Sima Zhao died and was succeeded as regent by his son Sima Yan, who later that year 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. 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 290, Yang Jun, the father ofEmpress Dowager Yang, assumed the regency for Sima Zhong, who ascended the throne as Emperor Hui. However, in 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. 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 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.