|King of Yan (燕王)|
|Administrator of Liaodong (遼東太守)|
|Preceded by||Gongsun Gong|
|Occupation||Military general, politician, warlord|
|Courtesy name||Wenyi (文懿)|
Gongsun Yuan (pronunciation (help·info)) (died 238), courtesy name Wenyi, was a Chinese military general, politician, and warlord who lived in the state of Cao Wei during the Three Kingdoms period of China. He rebelled against Wei in 237 and declared himself "King of Yan" (燕王). In 238, the Cao Wei general Sima Yi led forces to Liaodong and successfully conquered Yan.
Gongsun Yuan was a son of Gongsun Kang, a warlord who controlled Liaodong, Xuantu, Lelang and Daifang commanderies in the late Eastern Han dynasty. He became a vassal of the state of Cao Wei during the Three Kingdoms period. When Gongsun Kang died, his sons Gongsun Huang and Gongsun Yuan were still too young at the time to succeed him, so his younger brother Gongsun Gong took over. In 228, a grown-up Gongsun Yuan seized power from his uncle Gongsun Gong and imprisoned him.
Although Gongsun Yuan was nominally a vassal of the Cao Wei state, he considered switching allegiance to Wei's rival state, Eastern Wu. Gongsun Yuan eventually yielded under pressure from the Wei emperor Cao Rui. He killed the Wu delegates but some of them fled to Goguryeo. The Wu emperor Sun Quan attempted to form an alliance with Goguryeo to launch a pincer attack on Gongsun Yuan, but Goguryeo eventually sided with Wei against Gongsun Yuan.
In 237, the Wei emperor Cao Rui felt insecure about Gongsun Yuan's influence in the northeast, so he sent the general Guanqiu Jian to lead an army of Chinese, Wuhuan and Xianbei troops to attack Gongsun Yuan, but floods caused the campaign to be aborted. Gongsun Yuan declared himself "King of Yan" (燕) and concluded an alliance with Eastern Wu. The following year, the Wei generals Sima Yi and Guanqiu Jian led a campaign against Gongsun Yuan. Gongsun Yuan was defeated and killed while his clan was exterminated. As a consequence, Liaodong and present-day northwest Korea became Wei territories.