<P> From 1544 to 1549, Weng Wanda (翁 萬達; 1498--1552) embarked on a defensive building program on a scale unprecedented in Chinese history . Troops were re-deployed along the outer line, new walls and beacon towers were constructed, and fortifications were restored and extended along both lines . Firearms and artillery were mounted on the walls and towers during this time, for both defence and signalling purposes . The project's completion was announced in the sixth month of 1548 . At its height, the Xuan--Da portion of the Great Wall totalled about 850 kilometres (530 miles) of wall, with some sections being doubled - up with two lines of wall, some tripled or even quadrupled . The outer frontier was now protected by a wall called the "outer border" (外邊, wàibiān) that extended 380 kilometres (240 mi) from the Yellow River's edge at the Piantou Pass (偏 頭 關) along the Inner Mongolia border with Shanxi into Hebei province; the "inner border" wall (內 邊, nèibiān) ran southeast from Piantou Pass for some 400 kilometres (250 mi), ending at the Pingxing Pass; a "river wall" (河 邊, hébiān) also ran from the Piantou Pass and followed the Yellow River southwards for about 70 kilometres (43 mi). </P> <P> As with Yu Zijun's wall in the Ordos, the Mongols shifted their attacks away from the newly strengthened Xuan--Da sector to less well - protected areas . In the west, Shaanxi province became the target of nomads riding west from the Yellow River loop . The westernmost fortress of Ming China, the Jiayu Pass, saw substantial enhancement with walls starting in 1539, and from there border walls were built discontinuously down the Hexi Corridor to Wuwei, where the low earthen wall split into two . The northern section passed through Zhongwei and Yinchuan, where it met the western edge of the Yellow River loop before connecting with the Ordos walls, while the southern section passed through Lanzhou and continued northeast to Dingbian . The origins and the exact route of this so - called "Tibetan loop" are still not clear . </P> <P> In 1550, having once more been refused a request for trade, the Tümed Mongols under Altan Khan invaded the Xuan--Da region . However, despite several attempts, he could not take Xuanfu due to Weng Wanda's double fortified line while the garrison at Datong bribed him to not attack there . Instead of continuing to operate in the area, he circled around Weng Wanda's wall to the relatively lightly defended Gubeikou, northeast of Beijing . From there Altan Khan passed through the defences and raided the suburbs of Beijing . According to one contemporary source, the raid took more than 60,000 lives and an additional 40,000 people became prisoners . As a response to this raid, the focus of the Ming's northern defences shifted from the Xuan--Da region to the Jizhou (薊 州 鎮) and Changping Defence Commands (昌平 鎮) where the breach took place . Later in the same year, the dry - stone walls of the Jizhou--Changping area (abbreviated as "Ji - Chang") were replaced by stone and mortar . These allowed the Chinese to build on steeper, more easily defended slopes and facilitated construction of features such as ramparts, crenelations, and peepholes . The effectiveness of the new walls was demonstrated in the failed Mongol raid of 1554, where raiders expecting a repeat of the events of 1550 were surprised by the higher wall and stiff Chinese resistance . </P> <P> In 1567 Qi Jiguang and Tan Lun, successful generals who fended off the coastal pirates, were reassigned to manage the Ji--Chang Defense Commands and step up the defences of the capital region . Under their ambitious and energetic management, 1200 brick watchtowers were built along the Great Wall from 1569 to 1571 . These included the first large - scale use of hollow watchtowers on the Wall: up until this point, most previous towers along the Great Wall had been solid, with a small hut on top for a sentry to take shelter from the elements and Mongol arrows; the Ji--Chang towers built from 1569 onwards were hollow brick structures, allowing soldiers interior space to live, store food and water, stockpile weapons, and take shelter from Mongol arrows . </P>

When did the great wall of china get built