The easternmost length of the first Great Wall of China was built by the ancient Yan State, whose territory contained today's Beijing and Tianjin, and parts of Hebei and Liaoning Provinces.
Starting from Zhangjiakou it ran west to Liaoyang City in Liaoning. It was the last Great Wall section built in the Warring States Period.
There are ruins of the Yan Great Wall in Liaoning Province, and near Badaling, Beijing.
The Yan State was the northeastern-most vassal state since the beginning of the Zhou Dynasty (1046–221 BC). Its capital was Ji, today's Beijing, and it controlled today's northern Hebei and western Liaoning provinces.
By the Warring States Period (475 BC) it had become one of the strongest seven states, but was conquered by the state of Qin in 222 BC.
The Yan State "Great Wall" was built late in the reign of King Jiping (Yan Zhaowang 燕昭王, 312–279 BC). Yan, the northeast warring state, was a strong state. However, it was always harassed by the northern nomadic Mongol and Manchu people, not to mention the neighboring Qi and Zhao states.
The Yan State built their "Great Wall" to protect themselves from northern attacks from the Manchu, Mongols, and Zhao State.
The Yan State Wall became part of the united Qin Dynasty Great Wall, under the orders of First Emperor Qin in 221 BC, and have been part of the Great Wall of China in various dynasties until the end of the Ming Dynasty (1644).
The Yan State "Great Wall" ruins have not been developed for tourism, they aren't much to see, and are not popular with tourists, so we don't recommend visiting them.
The ruins of the Yan Great Wall in Jianping County (建平县), Chaoyang Prefecture, are its best existing section.
It was built across high mountains and valleys, with local stone and rammed earth. Its remains have a width of 2.5 meters or so and a height of 0.3–0.4 meters. The tower and fort relics can be seen more clearly.
Some ruins of the Yan Great Wall were found in Changping District (昌平区) northeast of Beijing, close to the Great Wall at Badaling, in a north-south section of about 30 km, including some in Zhangjiakou Prefecture, Hebei Province.
Most of the Yan relics were built over with the Ming Dynasty Great Wall. You could reach them by hiking south from Badaling, though access has been prohibited with a fence and sign on the Great Wall [since 2004].
There is public access at an almost unheard of tourist spot called 'Stone Gorge Pass Great Wall' (石峡关长城 Shixiaguan Changcheng), about 8 km (5 mi) south of Badaling.