<P> Soon after the establishment of the Tang dynasty, during the reign of Emperor Taizong (r . 626--649), the threat of Göktürk tribesmen from the north prompted some court officials to suggest drafting corvée labourers to repair the aging Great Wall . Taizong scoffed at the suggestion, alluding to the Sui walls built in vain: "The Emperor Yang of Sui made the people labor to construct the Great Wall in order to defend against the Turks, but in the end this was of no use ." Instead of building walls, Taizong claimed he "need merely to establish Li Shiji in Jinyang for the dust on the border to settle ." Accordingly, Taizong sent talented generals like Li Shiji with mobile armies to the frontier, while fortifications were mostly limited to a series of walled garrisons, such as the euphemistically - named "cities for accepting surrender" (受降 城, shòuxiáng chéng) that were actually bases from which to launch attacks . As a result of this military strategy, the Tang grew to become one of the largest of all the Chinese empires, destroying the Göktürks of the Eastern Turkic Khaganate and acquiring territory stretching all the way to Kazakhstan . </P> <P> Nevertheless, records show that in the Kaiyuan era (713--742) of Emperor Xuanzong's reign, the general Zhang Yue built a wall 90 li (48 kilometres (30 mi)) to the north of Huairong (懷 戎; present - day Huailai County, Hebei), although it remains unclear whether he erected new walls or only reinforced the existing Northern Qi walls . </P> <P> The Great Wall, or the ruins of it, features prominently in the subset of Tang poetry known as biansai shi (邊塞 詩, "frontier verse") written by scholar - officials assigned along the frontier . Emphasizing the poets' loneliness and longing for home while hinting at the pointlessness of their posts, these frontier verses are characterized by imagery of desolate landscapes, including the ruins of the now - neglected Great Wall--a direct product of Tang's frontier policy . </P> <P> After the Tang dynasty ended in 907, the northern frontier area remained out of Han Chinese hands until the establishment of the Ming dynasty in 1368 . During this period, non-Han "conquest dynasties" ruled the north: the Khitan Liao dynasty (907--1125) and the succeeding Jurchen Jin dynasty (1115--1234) in the east and the Tangut Western Xia (1038--1227) in the west, all of which had built walls against the north . </P>

Who built the great wall of china and how long did it take