The Yan Great Wall started in the west at Zaoyang (造陽) and ended in the east at Xiangping.
[3] In the chaos of the late Eastern Han Dynasty and early Three Kingdoms period, Liaodong Commandery prospered, due to its location far from the warlordism and warfare going on in China, and many scholars and talented individuals sought refuge at Xiangping.
Gongsun Du divided the Liaodong Commandery into three, establishing the Liangdong (辽东), Zhongliao (中辽), and Liaoxi (辽西) Commandaries.
Sima Yi ordered all of Gongsun Yuan's officials to be killed, and all men aged 15 and above in Xiangping to be massacred.
The important new martial position of Dongyi Jiaowei (东夷校尉) was established to govern over non-Han peoples.
In 274 AD, during the reign of Emperor Wu of Jin, Pingzhou (平州) was reestablished, governing the Liaodong (辽东郡), Xuantu (玄菟郡) and Changli (昌黎郡) Commandaries.
The region was contested territory between the northern Korean Kingdom of Goguryeo and the various imperial dynasties of China.
[4] The two political forces competed with each-other over trade and influence in the area by constructing fortresses in strategic locations.
The Chinese retaliated in 612 by launching a massive retaliatory attack into Goguryeo territory, laying siege to Yodong fortress.
Frustrated by the invasion's lack of progress, one third of the Sui army disengaged itself from the siege and marched on the Goguryeo capital of Pyongyang.
[4] Following the conflict with the Sui dynasty, Goguryeo strengthened its border defenses in preparation for a future war with the Chinese.
[6][7] The Tang were able to breach the fortress walls with a rapid cavalry assault, and Yodong was eventually captured and its inhabitants enslaved.
[7][8][4] Emperor Taizong of Tang would later intercede and offer freedom to the prisoners and the fortress was incorporated into a new Imperial prefecture.