Through China's long history three geographic areas have been vital to her overall defense. The first is the Tarim Basin, marked on many Western maps as the western half of the Gobi Desert. The second is the marshy grasslands of the Ordos, located around the great loop of the Yellow River, now in Inner Mongolia. The third area is the Orkhon river valley northwest of the Ordos in Outer Mongolia. Whoever controlled any of these three areas had a strong base from which to threaten China. The history of Dunhuang is rooted in China's attempts to defend her western border against threats from the Tarim basin.
From as early as the seventh century B.C.E., Chinese kingdoms built walls along their northern frontiers to defend themselves against the forays of savage Hun (Xiongnu) nomadic tribes. In 120 B.C.E., during the reign of Emperor Wu (147-87 B.C.E.) of the Western Han dynasty, the most comprehensive Great Wall project to date was initiated, with up to four systems of fortification spanning the breadth of China from Dunhuang in the west to the Korean peninsula in the east. Part of this Great Wall was constructed across the mouth of the Hexi Corridor from Dunhuang's Yumenguan (Jade Gate Pass) in the west to Jiayuguan, 180 miles to the east. Three years later in 117 B.C.E., Dunhuang was appointed a prefecture. For the next millennium, it remained one of China's most important command posts with heavy concentrations of military and civilian personnel.
Since the Hexi Corridor, a desert plain enclosed by two sets of mountains, links the eastern edge of the Tarim basin to China's heartland, Dunhuang's military significance as China's first line of defense from a western attack is clear. Indeed, "Dunhuang" itself means "Blazing Beacon" and refers to a series of beacons – 70 of which remain to this day – used to communicate news of enemy movements to military authorities in the east.
With the rise of the Silk Road and its resultant commerce in trade and ideas, Dunhuang's role and character altered. Though its importance as a garrison remained, it now doubled as a trading post and cultural center. Many cultural relics testify to its wealth and power as a trading area. For example, paper dating back to 94 B.C.E., 170 years before it was previously thought to have been invented, has recently been found here. There can be no greater testament to its cultural significance than the nearby Mogao Caves , Yulin Caves and the Western Thousand Buddha Caves.
From its inception to the end of the Tang dynasty (618-907 C.E.), Dunhuang remained an important center in China's political, economic and military life. However, when China's capital moved eastwards from Xi'an – out of the threatening purview of the Tarim basin – as commerce transferred from land to sea routes, so did Dunhuang gradually lose its national significance.