The fortification of the city of Xi’an, the ancient capital of Shaanxi province, in the center of the Guanzhong Plain, represents one of the oldest and best preserved Chinese city walls. The wall was built in the 14th century by Zhu Yuanzhang, the first Emperor of the Ming Dynasty, under the advice of a hermit who told him to “built high walls, store abundant food supplies and take time to be an Emperor,” so that he could fortify the city and unify the other states. After the establishment of the Ming dynasty, Zhu Yuanzhang followed his advice and began to enlarge the wall built initially during the old Tang Dynasty (618 - 907), creating the modern Xian City Wall. It's the most complete city wall that has survived in China, as well being one of the largest ancient military defensive systems in the world.
The original Xi’an city wall was started in 194 BCE and took 4 years to finish. Upon completion, the wall measured 25.7 km in length and 12–16 m in thickness at the base, and enclosed an area of 36 square km. The first city wall was built of earth, quick lime, and glutinous rice extract, tamped together. Later, the wall was totally enclosed with bricks.
Xi’an's city wall, after its enlargement in the Ming Dynasty, stands 12 meters high. It is 12-14 meters across the top, 15-18 meters thick at bottom, and 13.7 kilometers in length and encircles an area of roughly 14 square kilometers within the city. There is a rampart every 120 meters that extend out from the main wall and allow soldiers to see enemies trying to climb the wall. The distance between every two ramparts is just within the range of arrow shot from either side.
There are four main gates on the wall, which were the only way to go into and out of town in ancient times. Each gate is overlooked by sentries on three towers. A wide moat ran around the city. Over the moat, there used to be huge drawbridges, which would cut off the way in and out of the city, once lifted.
Today, the Ming dynasty wall is mostly intact and open to visitors. It is possible to walk the entire perimeter of the wall, however, cycling is the best way to explore the historic city wall. The wall has a road on the top perfect for walking or biking. In fact, cycling atop the city wall is one of the popular activities on Xi’an. Cycling is also a great way to see the old city.