After the First Emperor unified China, Jicheng became a prefectural capital for the region.[1] During the Three Kingdoms period, it was held by Gongsun Zan and Yuan Shao before falling to the Wei Kingdom of Cao Cao. The AD 3rd-century Western Jin demoted the town, placing the prefectural seat in neighboring Zhuozhou.
During the Sixteen Kingdoms period when northern China was conquered and divided by the Wu Hu, Jicheng was briefly the capital of the Xianbei Former Yan Kingdom.[45]
After China was reunified during the Sui dynasty, Jicheng, also known as Zhuojun, became the northern terminus of the Grand Canal. Under the Tang dynasty, Jicheng as Youzhou, served as a military frontier command center. During the An-Shi Rebellion and again amidst the turmoil of the late Tang, local military commanders founded their own short-lived Yan dynasties and called the city Yanjing, or the "Yan Capital." Also in the Tang dynasty, the city's name Jicheng was replaced by Youzhou or Yanjing. In 938, after the fall of the Tang, the Later Jin ceded the entire northern frontier to the Khitan Liao dynasty, which treated the city as Nanjing, or the "Southern Capital", one of four secondary capitals to complement its "Supreme Capital", Shangjing (modern Baarin Left Banner in Inner Mongolia). Some of the oldest surviving structures in Beijing date to the Liao period, including the Tianning Pagoda.
The Liao fell to the Jurchen Jin dynasty in 1122, which gave the city to the Song dynasty and then retook it in 1125 during its conquest of northern China. In 1153, the Jurchen Jin made Beijing their "Central Capital", or Zhongdu.[1] The city was besieged by Genghis Khan's invading Mongolian army in 1213 and razed to the ground two years later.[46] Two generations later, Kublai Khan ordered the construction of Dadu (or Daidu to the Mongols, commonly known as Khanbaliq), a new capital for his Yuan dynasty to the northeast of the Zhongdu ruins. The construction took from 1264 to 1293,[1][46][47] but greatly enhanced the status of a city on the northern fringe of China proper. The city was centered on the Drum Tower slightly to the north of modern Beijing and stretched from the present-day Chang'an Avenue to the northern part of Line 10 subway. Remnants of the Yuan rammed earth wall still stand and are known as the Tucheng.[48]