Who was the Great Wall of China built to keep out?

As the most formidable military defense structure in ancient China, the Great Wall’s defensive objectives were not static; they evolved alongside shifting political landscapes across history. Its primary purpose was to enable Central Plains dynasties to defend against nomadic powers from the north and northwest, while also serving as a defensive barrier between rival states.
 
Great Wall of China
Great Wall of China

The fortunes of Central Plains regimes rose and fell over time. First constructed during the State of Chu, the Great Wall saw massive expansion under the Qin and Han dynasties, and most of its surviving sections were built during the Ming Dynasty. Each dynasty faced distinct external threats, as northern nomadic tribes continuously grew, evolved, migrated, or integrated with one another. Below is an overview of the defensive contexts of several major dynasties.
 

Zhou Dynasty (1046 - 256 BC): Other States

The Great Wall of China was first built by various states during the Zhou Dynasty to block invasions from neighboring states. For instance, the Qi State built the wall to block the Chu State, and the Chu built it to block the Qi and Qin States. 
 

Qin and Han Dynasties (221 BC - 220 AD): Huns

Beginning with the Qin Dynasty (221 - 207 BC), it was mainly used to keep out nomadic invaders. After Emperor Qin Shi Huang unified the central plain and set up the Qin Dynasty, the Huns, or Xiongnu, grew strong and often ran across the northern border to rob the people, so the emperor directed that the existing walls of different states be linked to block them.

The Huns were still a threat in the Han Dynasty (202 BC - 220 AD), so the rulers used the previous Qin Great Wall and built some new sections to keep them out.
 

Jin Dynasty (266 - 420 AD): Xianbei

Many historians think the Jin Dynasty is one of the dynasties in Chinese history that did not help build the Great Wall. Actually, early in this period, the Xianbei frequently attacked the northeast border, and the previous Qin Dynasty Great Wall was reinforced to keep them out.
 
Tangut
Khitan
Hun
Hun
 

Northern and Southern Dynasties (420 - 589 AD): Rouran, Turk, Khitan, and Other Countries

The Northern and Southern Dynasties was a tumultuous period when regimes changed frequently, and a few countries even coexisted at the same time in the central plain. Afraid of attacks from other countries, defensive sections were added in different areas. In addition, the powerful nomadic tribes in the north, mainly including the Rouran, Turk, and Khitan, were also those the Great Wall aimed to keep out.
 

Sui and Tang Dynasties (581 - 907 AD): Turk

In the Sui Dynasty (581 - 618 AD) and the early Tang Dynasty (618 - 907 AD), the Turks were the biggest threat. The Emperor Yang of Sui commanded that the Great Wall be built extensively along the northern border to keep them out. In the early Tang Dynasty, the previous walls were still in use. Later, as the Tang became stronger and stronger, the northern nomadic tribes were not really threats at all, diminishing the defensive function of the Great Wall.
 

Song Dynasty (960 - 1279 AD): Khitan, Tangut, and Jurchen

In the Song Dynasty, the northern nomadic groups became so powerful that they founded their own empires called the Liao Dynasty (907 - 1125 AD) of Khitan, the Western Xia Dynasty (1038 - 1227 AD) of Tangut, and the Jin Dynasty  of Jurchen, respectively. Some sections of the Song Great Wall were built more in the south because the Jurchen narrowed the Song territory to the south of the Yangtze River.
 

Jin Dynasty (1115 - 1234 AD): Tangut and Mongol

The Jin Dynasty built the Great Wall twice: once from 1194 to 1201 to keep out the Tangut people and other small nomadic tribes, and again from 1210 to 1211 to keep out the Mongols. However, the Jin Great Wall did not keep out the Mongols led by Genghis Khan, who broke through it and set up the Yuan Dynasty (1271 - 1368 AD).

You may like: How did Genghis Khan breach China Great Wall?
 
Statue of Genghis Khan
Statue of Genghis Khan
The war between the Rouran and the Wei state
The war between the Mongol and the Jin state
 

Ming Dynasty (1368 - 1644 AD): Tatar, Oirat, and Jurchen

After the Mongols were driven back to the northern grassland, they divided into two groups, Tatar and Oirat, and kept attacking the northern border. Meanwhile, the Jurchen, later known as the Manchu, in the northeast grew stronger and became a big threat, so the Ming Great Wall was built to protect the territory.
 

Famous Great Wall Battles:

General Meng Tian Attacked the Huns in the North
Wei Qing and Huo Qubing Beat Back the Huns
Tumu Crisis
The War of Shanhaiguan Great Wall
Battle of Rehe - Last Battle on the Great Wall
- Last updated on Feb. 26, 2026 by Sherry Xia -