The Great Wall of China is a series of stone and earthen fortifications in northern China, built originally to protect the northern borders of the Chinese Empire against intrusions by various nomadic groups. Several walls have been built since the 5th century BC that are referred to collectively as the Great Wall, which has been rebuilt and maintained from the 5th century BC through the 16th century. One of the most famous is the wall built between 220–206 BC by the first Emperor of China, Qin Shi Huang. Little of that wall remains; the majority of the existing wall was built during the Ming Dynasty.
The Great Wall stretches from Shanhaiguan in the east, to Lop Lake in the west, along an arc that roughly delineates the southern edge of Inner Mongolia. The most comprehensive archaeological survey, using advanced technologies, has concluded that all the walls measure 8,851.8 km (5,500.3 mi). This is made up of 6,259.6 km (3,889.5 mi) sections of actual wall, 359.7 km (223.5 mi) of trenches and 2,232.5 km (1,387.2 mi) of natural defensive barriers such as hills and rivers.
The Chinese were already familiar with the techniques of wall-building by the time of the Spring and Autumn Period, which began around the 8th century BC. During the Warring States Period from the 5th century BCE to 221 BCE, the states of Qin, Wei, Zhao, Qi, Yan and Zhongshan all constructed extensive fortifications to defend their own borders. Built to withstand the attack of small arms such as swords and spears, these walls were made mostly by stamping earth and gravel between board frames.
Qin Shi Huang conquered all opposing states and unified China in 221 BCE, establishing the Qin Dynasty. Intending to impose centralized rule and prevent the resurgence of feudal lords, he ordered the destruction of the wall sections that divided his empire along the former state borders. To protect the empire against intrusions by the Xiongnu people from the north, he ordered the building of a new wall to connect the remaining fortifications along the empire's new northern frontier. Transporting the large quantity of materials required for construction was difficult, so builders always tried to use local resources. Stones from the mountains were used over mountain ranges, while rammed earth was used for construction in the plains. There are no surviving historical records indicating the exact length and course of the Qin Dynasty walls. Most of the ancient walls have eroded away over the centuries, and very few sections remain today. The human cost of the construction is unknown, but it has been estimated by some authors that hundreds of thousands, if not up to a million, workers died building the Qin wall. Later, the Han, Sui, and Northern dynasties all repaired, rebuilt, or expanded sections of the Great Wall at great cost to defend themselves against northern invaders. The Tang and Song Dynasties did not build any walls in the region. The Liao, Jin, and Yuan dynasties, who ruled Northern China throughout most of the 10-13th centuries, had their original power bases north of the Great Wall proper; accordingly, they would have no need throughout most of their history to build a wall along this line. The Liao carried out limited repair of the Great Wall in a few areas, however the Jin did construct defensive walls in the 12th century, but those were located much to the north of the Great Wall as we know it, within today's Inner and Outer Mongolia.