The City Wall of Nanjing (Chinese: 南京城墙; pinyin: Nánjīng chéngqiáng) was designed by Emperor Zhu Yuanzhang (r. 1328–1398) after he founded the Ming Dynasty (1368–1644) and established Nanjing as the capital 600 years ago. To consolidate his sovereignty and keep out invaders, he adopted the suggestions of advisor Zhu Sheng to build a higher city wall, to collect grains and to postpone the coronation. Then, he started to build the city wall. It took 21 years to complete, and used 200,000 laborers to move 7 million cubic metres of earth. The City Wall of Nanjing was among the largest city walls ever constructed in China. The enclosed Nanjing City is about 55 square kilometers.
The first Ming emperor was proclaimed in 1368 and a great deal of preparation was done prior to this to have an imperial city and all the imperial trappings ready. The name of the city was changed again to Yingtianfu (responding to heaven). A "new city" was built to the east of the old one to be used as a new palace or "forbidden" city. This city was laid out in much the same pattern as Beijing; indeed Nanjing’s was the pattern for Beijing’s Forbidden City.
In expanding the walls, it appears the Hongwu Emperor intended initially to simply add a bulge to the existing walls and encompass the New City to the east. The main north gate would have been the Drum Tower. However, it was decided to bring Lion Hill to the northwest into the city defences for strategic reasons, and this almost doubled the area the walls would encompass. In addition to the surviving walls of stone and brick, an outwall was built along the river and to the south as an additional defensive measure. Old maps show that there were close to twenty gates in this rammed earth wall. This outwall is long gone, but the names of the gates survive as local place names. Part of the wall on the south shore of Xuanwu Lake was built on the foundations of the old Stone City walls from the Six Dynasties period, and reused many of the bricks from that old wall.
Originally, thirteen gates were built through Nanjing’s walls, but this number had grown to eighteen by the end of the Qing dynasty. Of the thirteen original gates, only Zhonghua Gate in the south, originally known as Jubao Gate, and Heping Gate in the north, originally called Shenci Gate, are still standing. Heping Gate is closed to the public as it is still used as an army barracks. Parts of other gates survive or have been partially reconstructed. The remains of a west gate, Hanzhongmen, originally called Shichengmen, stand in the middle of a plaza. These walls are part of the last of a series of three or four courtyards that made up the gate complex. During the Qing dynasty three more gates were added, including an entrance to Xuanwu Lake from the west built in 1910. Yijiang Gate on North Zhongshan Road was built in 1921, as was the major entrance to the city during Republican times when most visitors to the city arrived by boat at the docks just to the west.