The City Wall of Nanjing was designed by the Hongwu Emperor (1328–1398) after he founded the Ming Dynasty (1368–1644) and established Nanjing as the capital in 1368.

To consolidate his sovereignty and defend the city against coastal pirates, he adopted the suggestions of advisor Zhu Sheng to build a higher city wall, expand strategic food reserve, and postpone the coronation. The construction of the wall required the labor of 200,000 workers over twenty-one years to complete. Around 7 million cubic meters of earth were shifted. The City Wall of Nanjing was among the largest city walls ever constructed in China. The enclosed Nanjing City is about 55 square kilometers.

Different from ancient city walls in Beijing and Xi’an, its design and construction were unique and changed the old ways of equilibrium and symmetry. The construction concentrated on military defense because the city was at the foot of a mountain—a natural barrier to control the commanding elevation with the river as its natural city moat. Because of this, the 60-square-kilometer Nanjing city became strategically located and difficult to reach.

The wall belonged to a military defensive system too. The difference was that it adopted a winding, freestyle, based on the city’s complicated topography. The construction of the Beijing and the Xi’an city walls was in the ancient style of square or rectangular design. When it was built by the second son of Emperor Zhu Yuanzhang, the 12-kilometer-long Xi’an city wall became the seat of local government. It could not match the scale of the capital Nanjing at that time.

Today the 600-year-old city wall of Nanjing still stands. Experts from Nanjing Cultural Relic Bureau say most of the foundations use granite, rectangle stones, or limestone. The walls were packed layer by layer with broken bricks, gravel, and yellow earth. All the brickwork joints were poured with mixed lime, water in which glutinous rice had been cooked, and tung oil because the coagulated mixture was very strong. That is why the city wall has stood for a long time. On top of the outer wall were 13,616 crenellations, or battlements, for defenders of the city to observe the enemy or dodge arrows. Opposite it was the parapet wall used as a balustrade to keep the defenders and horses safe. Standing on the wall, you will see tall ancient trees under your feet. Aside from the top wall, there are stone sluices to drain rain and near the wall’s foundation, there are further outlets. The ancient city wall was listed as a key cultural relic under state protection in 1988.

According to wikipedia