Beijing is first mentioned in history in the chronicles of the Zhou Dynasty's conquest of the Shang Dynasty in the 11th century BC. According to Sima Qian's Records of the Grand Historian, King Wu of Zhou, in the 11th year of his reign, deposed the last Shang king and conferred titles to nobles within his domain, including the rulers of the city states Ji (?/?) and Yan (?). The walled City of Ji or Jicheng (??/??) was located in the southwestern part of present-day Beijing, just south of Guang'anmen in Xicheng and Fengtai Districts. According to Confucius, the rulers of Ji were descendants of the Yellow Emperor. Some time during the late Western Zhou or early Eastern Zhou Dynasty, Ji was absorbed by neighboring Yan, which made the City of Ji, its capital.
Yan's capital was previously based to the south of Ji, in the village of Dongjialin in Liulihe Township of Fangshan District, where a large walled settlement and over 200 tombs of nobility have been unearthed. Among the most significant artifacts from the Liulihe site is a bronze ding with inscriptions that recount the journey of the eldest son of the Duke of Yan who delivered offerings to the King of Zhou in present-day Xi'an, and was awarded a position in the king's court. Both Yan and Ji were located along an important north-south trade route along the eastern flank of the Taihang Mountains from the Central Plain to the northern steppes. Ji, located just north of the Yongding River, was a convenient resting stop for trade caravans. Here, the route to the northwest through the mountain passes diverged from the road to the northeast. Ji also had a steady water supply from the nearby Lotus Pond, which still exists south of the Beijing West Railway Station. Yan's old capital relied on the more seasonal flow of the Liuli River. Perhaps for these reasons, Yan chose to move its capital to Ji, which remains to be known as Jicheng or the City of Ji. Due to its historical association with the State of Yan, the city of Beijing is also called Yanjing (??) or "Yan Capital".
The State of Yan would continue to expand until it became one of the seven major powers during the Warring States Period (473-221 BC). It stretched from the Yellow River to the Yalu. Historical records show that the Yan capital was a wealthy city with at least two palaces. In 284 BC, the victorious Yan general Yue Yi, having conquered 70 cities of neighboring Qi, wrote to Duke of Yan to report that he had enough booty to fill two palaces and planned to bring home a new tree species to plant on the Hill of Ji, north of the city.The hill mentioned in the letter is believed to be the mound at the White Cloud Abbey, outside Xibianmen in Xicheng District. Like subsequent rulers of Beijing, the Yan also faced the threat of invasions by steppe nomads, and built walled fortifications across its northern frontier. Remnants of the Yan walls in Changping County dates to 283 BC. They predate Beijing's better known Ming Great Wall by more than 1,500 years.
In 226 BC, the City of Ji fell to the invading State of Qin and the State of Yan was forced to move its capital to Liaodong. The Qin eventually ended Yan in 222 BC. The following year, the ruler of Qin, having conquered all the other states, declared himself to be the First Emperor.