Studying the history of the Great Wall is complicated because lengths of wall were built in different areas at different periods in history to protect different territorial borders, and in some places lengths of wall have been rebuilt on top of previously destroyed or eroded wall.
It's generally believed that the first parts of the Great Wall were built during the Spring and Autumn Period, when the eastern and central region of what is now China consisted of many small states or princedoms.
To protect their states the princes ordered independent walls be built along state borders. These were like the Great Wall in construction, but on a smaller scale. The earliest was probably built between the states of Lu and Qi around 650 BC, which later became part of the Chu State Wall.
As rival states fought for territory and power, the influence of the Zhou kings waned. The small states were joined together by warlords by the beginning of the Warring States Period to form seven large states. (Chu, Qi, Wei, Yan, Zhao, Qin, and Han)
The outcome of the Warring States Period was that the State of Qin proved to be the stronger, conquering and unifying the other states. Qin Shihuang (king of the State of Qin from 247–221 BC) became the first emperor of China and ruled China for most of the short Qin Dynasty.
Emperor Qin Shihuang ordered that the northern sections of wall on state borders, especially the walls in the northern part of China built by the states of Qin, Zhao and Yan, be joined together to form a unified line of defense against Mongol harassment from the north, the first true Great Wall. It took a million workers 9 years. Other state border walls became obsolete in a unified China and were subsequently eroded or dismantled.
When it was finished, the total length of wall exceeded 5,000 kilometers (3,100 miles), and became known as the 10,000-Li-Long-Wall (one li is 0.5 km). The Qin Great Wall wound its way from Linrao, Gansu Province in the west to the Liaodong Peninsula, Liaoning Province. Read more on the Qin Great Wall.
After Qin Shihuang's death in 210 BC, the Qin Dynasty failed to maintain its authority and was replaced by the Han Dynasty. It was one of the golden ages of China when the nation was consolidated.
The northern fortifications were strengthened and lengthened, with sections of wall running parallel for hundreds of kilometers and interlinking along the Inner Mongolian border. The Han Dynasty Great Wall from the North Korea coast near Pyongyang in the east to Jade Gate Pass in the west was the longest the Great Wall has ever been at more than 8,000 km (5,000 miles). The total length included many branching walls, natural barriers, and trenches.
Read more on the Han Great Wall.
The construction and maintenance of the Great wall continued for nearly all the Chinese feudal dynasties. The smaller and less powerful dynasties of fractured post-Han-Dynasty China (North Wei, North Qi, East Wei, and North Zhou) all spent a lot on the Great Wall.
The Northern Qi Dynasty (550–577) was short but saw some significant additions comprising the Northern Qi Great Wall in the Shanxi Province area, including an 'Inner Great Wall' as a second line of defense against the Mongols.
The Sui Dynasty (581–618) saw extensive rebuilding of the Great Wall, while the following Tang Dynasty (618–907), the culmination of China's feudal age, didn't do any work on the Great wall owing to its superior power and advantage over its northern nomad neighbors.
The Song Dynasty, known for its development of China's economy and trade, had a history of building the Great Wall to prevent invasions of Liao, Western Xia and Jin in the north and northwest. The Jin, or Manchus, hovever did get through the Great Wall and controlled the north of China during the Jin Dynasty (1115–1234). The Jin Great Wall was unable to stop the vast Mongol Empire invading, consuming China, and beginning the Yuan Dynasty.
The Yuan Dynasty was the first dynasty in which the whole of China was controlled by a non-Han people, the Mongols. The Great Wall had done a good job of preserving Han China for 1,500 years. Building of the Great Wall, not surprisingly, ceased during the Yuan Dynasty, as China and Mongolia to the north were one.
When the Yuan Dynasty collapsed due to civil unrest the Chinese Han once again took control under the command of rebel leader Zhu Yuanzhang, who became the first emperor of the Ming Dynasty. China flourished during the Ming Dynasty and its military might swell. The Great Wall was systematically rebuilt in a 100-year project to prevent further northern invasion.
Most of the remaining Great Wall was built in the Ming Dynasty, and is known as the Ming Great Wall. The Great Wall sections close to Beijing like the Badaling section and Mutianyu section were built during the Ming Dynasty.
Map showing the key forts on the Ming Dynasty Great Wall.
Read more on the Ming Great Wall.
A breach in the Great Wall at Shanhai Pass in 1644 by Manchu forces signaled the end of Han control in China for the last and final Chinese dynasty, the Qing Dynasty (1644–1911). It also signaled the end of construction and maintenance of the Great Wall, until the Badaling section was restored by the government of the Peoples' Republic of China, and opened to the public in 1957 as a tourist attraction.
Since then other sections have been restored and opened to the public. See a list of Great Wall sections close to Beijing