The Great Wall of China (Chinese: 萬里長城; pinyin: Wànlǐ Chángchéng) is the collective name of a series of fortification systems generally built across the historical northern borders of China to protect and consolidate territories of Chinese states and empires against various nomadic groups of the steppe and their polities. Several walls were being built from as early as the 7th century BC by ancient Chinese states; selective stretches were later joined together by Qin Shi Huang (220–206 BC), the first Emperor of China. Little of the Qin wall remains. Later on, many successive dynasties have built and maintained multiple stretches of border walls. The most well-known sections of the wall were built by the Ming dynasty (1368–1644).
Apart from defense, other purposes of the Great Wall have included border controls, allowing the imposition of duties on goods transported along the Silk Road, regulation or encouragement of trade and the control of immigration and emigration. Furthermore, the defensive characteristics of the Great Wall were enhanced by the construction of watch towers, troop barracks, garrison stations, signaling capabilities through the means of smoke or fire, and the fact that the path of the Great Wall also served as a transportation corridor.
The frontier walls built by different dynasties have multiple courses. Collectively, they stretch from Liaodong in the east to Lop Lake in the west, from the present-day Sino–Russian border in the north to Taohe River in the south; along an arc that roughly delineates the edge of Mongolian steppe. A comprehensive archaeological survey, using advanced technologies, has concluded that the walls built by the Ming dynasty measure 8,850 km (5,500 mi). This is made up of 6,259 km (3,889 mi) sections of actual wall, 359 km (223 mi) of trenches and 2,232 km (1,387 mi) of natural defensive barriers such as hills and rivers. Another archaeological survey found that the entire wall with all of its branches measures out to be 21,196 km (13,171 mi). Today, the defensive system of Great Wall is generally recognized as one of the most impressive architectural feats in history.
The Chinese were already familiar with the techniques of wall-building by the time of the Spring and Autumn period between the 8th and 5th centuries BC. During this time and the subsequent Warring States period, the states of Qin, Wei, Zhao, Qi, Han, 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 stone or stamping earth and gravel between board frames.
King Zheng of Qin conquered the last of his opponents and unified China as the First Emperor of the Qin dynasty ("Qin Shi Huang") in 221 BC. Intending to impose centralized rule and prevent the resurgence of feudal lords, he ordered the destruction of the sections of the walls that divided his empire among the former states. To position the empire against the Xiongnu people from the north, however, he ordered the building of new walls to connect the remaining fortifications along the empire's northern frontier. "Build and move on" was a central guiding principle in constructing the wall, implying that the Chinese were not erecting a permanently fixed border. 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 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, the Northern Dynasties and the Sui 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 undertake any significant effort in the region. Non-Han dynasties also built their border walls: the Xianbei-ruled Northern Wei, the Khitan-ruled Liao, Jurchen Jin and the Tangut-established Western Xia, who ruled vast territories over Northern China throughout centuries, all constructed defensive walls but those were located much to the north of the other Great Walls as we know it, within China's province of Inner Mongolia and in Mongolia itself.
The Great Wall concept was revived again under the Ming in the 14th century, and following the Ming army's defeat by the Oirats in the Battle of Tumu. The Ming had failed to gain a clear upper hand over the Mongolian tribes after successive battles, and the long-drawn conflict was taking a toll on the empire. The Ming adopted a new strategy to keep the nomadic tribes out by constructing walls along the northern border of China. Acknowledging the Mongol control established in the Ordos Desert, the wall followed the desert's southern edge instead of incorporating the bend of the Yellow River.
Unlike the earlier fortifications, the Ming construction was stronger and more elaborate due to the use of bricks and stone instead of rammed earth. Up to 25,000 watchtowers are estimated to have been constructed on the wall. As Mongol raids continued periodically over the years, the Ming devoted considerable resources to repair and reinforce the walls. Sections near the Ming capital of Beijing were especially strong. Qi Jiguang between 1567 and 1570 also repaired and reinforced the wall, faced sections of the ram-earth wall with bricks and constructed 1,200 watchtowers from Shanhaiguan Pass to Changping to warn of approaching Mongol raiders. During the 1440s–1460s, the Ming also built a so-called "Liaodong Wall". Similar in function to the Great Wall (whose extension, in a sense, it was), but more basic in construction, the Liaodong Wall enclosed the agricultural heartland of the Liaodong province, protecting it against potential incursions by Jurched-Mongol Oriyanghan from the northwest and the Jianzhou Jurchens from the north. While stones and tiles were used in some parts of the Liaodong Wall, most of it was in fact simply an earth dike with moats on both sides.
Towards the end of the Ming, the Great Wall helped defend the empire against the Manchu invasions that began around 1600. Even after the loss of all of Liaodong, the Ming army held the heavily fortified Shanhai Pass, preventing the Manchus from conquering the Chinese heartland. The Manchus were finally able to cross the Great Wall in 1644, after Beijing had already fallen to Li Zicheng's rebels. Before this time, the Manchus had crossed the Great Wall multiple times to raid, but this time it was for conquest. The gates at Shanhai Pass were opened on May 25 by the commanding Ming general, Wu Sangui, who formed an alliance with the Manchus, hoping to use the Manchus to expel the rebels from Beijing. The Manchus quickly seized Beijing, and eventually defeated both the rebel-founded Shun dynasty and the remaining Ming resistance, establishing the Qing dynasty rule over all of China.
Under Qing rule, China's borders extended beyond the walls and Mongolia was annexed into the empire, so constructions on the Great Wall were discontinued. On the other hand, the so-called Willow Palisade, following a line similar to that of the Ming Liaodong Wall, was constructed by the Qing rulers in Manchuria. Its purpose, however, was not defense but rather to prevent Han Chinese migration into Manchuria.