The city of Beijing has a long and rich history that dates back over 3,000 years. Prior to the unification of China by the First Emperor in 221 BC, Beijing had been for centuries the capital of the ancient states of Ji and Yan. During the first millennia of imperial rule, Beijing was a provincial city in northern China. Its stature grew in the 10th to the 13th centuries when the nomadic Khitan and forest-dwelling Jurchen peoples from beyond the Great Wall expanded southward and made the city a capital of their dynasties, the Liao and Jin. When Kublai Khan made Dadu the capital of the Mongol-led Yuan dynasty (1279–1368), all of China was ruled from Beijing for the first time. From 1279 onward, with the exception of two interludes from 1368 to 1420 and 1928 to 1949, Beijing would remain as China's capital, serving as the seat of power for the Ming dynasty (1421–1644), the Manchu-led Qing dynasty (1644–1912), the early Republic of China (1912–1928) and now the People's Republic of China (1949–present).
The earliest remains of hominid habitation in Beijing Municipality were found in the caves of Dragon Bone Hill near the village of Zhoukoudian in Fangshan District, where the Homo erectus Peking Man (Sinanthropus pekinensis) lived from 770,000 to 230,000 years ago.Paleolithic homo sapiens also lived in the caves from about 27,000 to 10,000 years ago.