Chang'an ([ʈʂʰǎŋ.án] (); simplified Chinese: 长安; traditional Chinese: 長安) was an ancient capital of more than ten dynasties in Chinese history, today known as Xi'an. Chang'an means "Perpetual Peace" in Classical Chinese since it was a capital that was repeatedly used by new Chinese rulers. During the short-lived Xin dynasty, the city was renamed "Constant Peace" (Chinese: 常安; pinyin: Cháng'ān); the old name was later restored. By the time of the Ming dynasty, a new walled city named Xi'an, meaning "Western Peace", was built at the Sui and Tang dynasty city's site, which has remained its name to the present day.
Chang'an had been settled since Neolithic times, during which the Yangshao culture was established in Banpo in the city's suburb. Also in the northern vicinity of the modern Xi'an, Qin Shi Huang of the Qin dynasty held his imperial court, and constructed his massive mausoleum guarded by the famed Terracotta Army.
From its capital at Xianyang, the Qin dynasty ruled a larger area than either of the preceding dynasties. The imperial city of Chang'an during the Han dynasty was located northwest of today's Xi'an. During the Tang dynasty, the area to be known as Chang'an included the area inside the Ming Xi'an fortification, plus some small areas to its east and west, and a major part of its southern suburbs. The Tang Chang'an hence was 8 times the size of the Ming Xi'an, which was reconstructed upon the site of the former imperial quarters of the Sui and Tang city. During its heyday, Chang'an was one of the largest and most populous cities in the world. Around AD 750, Chang'an was called a "million people's city" in Chinese records, while modern estimates put it at around 800,000–1,000,000 within city walls. According to the census in 742 recorded in the New Book of Tang, 362,921 families with 1,960,188 persons were counted in Jingzhao Fu (京兆府), the metropolitan area including small cities in the vicinity.
The strategic and economic importance of ancient Chang'an was mainly due to its central position. The roads leading to Gansu, Sichuan, Henan, Hubei and Shanxi all converged there. The mountainous country surrounding the Wei River basin led to the existence of only two practicable roads through to the south, and two through mountainous Gansu to the west, forming the beginning of the ancient Silk Routes. Chinese itineraries gave the following distances:
The site of the Han capital was located 3 km northwest of modern Xi'an. As the capital of the Western Han, it was the political, economic and cultural center of China. It was also the eastern terminus of the Silk Road, and a cosmopolitan metropolis. It was a consumer city, a city whose existence was not primarily predicated upon manufacturing and trade, but rather boasted such a large population because of its role as the political and military center of China. By 2 AD, the population was 246,200 in 80,000 households. This population consisted mostly of the scholar gentry class whose education was being sponsored by their wealthy aristocratic families. In addition to these civil servants was a larger underclass to serve them.
Initially, Emperor Liu Bang decided to build his capital at the center of the sun[clarification needed], which according to Chinese geography was in modern Luoyang. This location was the site of the holy city Chengzhou, home of the last Zhou emperors. The magical significance of this location was believed to ensure a long-lasting dynasty like the Zhou, whom the Han sought to emulate. However, the strategic military value of a capital located in the Wei Valley became the deciding factor for locating the new capital. To this end, it is recorded c 200 BC he forcibly relocated thousands of clans in the military aristocracy to this region. The purpose was twofold. First, it kept all potential rivals close to the new Emperor, and second, it allowed him to redirect their energy toward defending the capital from invasion by the nearby Xiongnu. His adviser Liu Jing described this plan as weakening the root while strengthening the branch.
After the necessary political structure was set up, the area of the capital was divided into three prefectures and construction began. At its founding in 195 BC, the population of Changan was 146,000. During the reign of Emperor Wu of Han, the diplomat Zhang Qian was dispatched westward into Central Asia. Since then, Chang'an city became the Asian gateway to Europe as the point of departure of the famous Silk Road. On 4 October 23 AD, Chang'an was captured and sacked during a peasant rebellion. The emperor, Wang Mang was killed and decapitated by the rebels two days later. After the Western Han period, the Eastern Han government settled on Luoyang as the new capital. Chang'an was therefore also sometimes referred to as the Western Capital or Xijing (西京) in some Han dynasty texts. In 190 AD during late Eastern Han, the court was seized and relocated back to Chang'an by the notorious Prime Minister Dong Zhuo, as it was a strategically superior site against the mounting insurgency formed against him. After Dong's death (192) the capital was moved back to Luoyang in August 196, and to Xuchang in autumn 196. By this time, Chang'an was already regarded as the symbolic site of supreme power and governance.
The 25.7 km long city wall was initially 3.5 m wide at the base tapering upward 8 m for a top width of 2 m. Beyond this wall, a 6.13 m wide moat with a depth of 4.62 m was spanned by 13.86 m long stone bridges. The wall was later expanded to 12–16 m at base and 12 m high. The moat was expanded to 8 m wide and 3 m deep. The expansion of the wall was likely a solution to flooding from the Wei River. The entire city was sited below the 400 m contour line which the Tang Dynasty used to mark the edge of the floodplain.
Twelve gates with three gateways each per the ritual formulas of Zhou dynasty urban planning pierced the wall. These gates were distributed three per a side and from them eight 45 m wide main avenues extended into the city. These avenues were also divided into three lanes aligned with the three gateways of each gate. The lanes were separated by median strips planted with Pine, Elm, and Scholar trees. Bachengmen Avenue was an exception with a width of 82 m and no medians. Four of the gates opened directly into the palaces.
The overall form of the city was an irregular rectangle. The ideal square of the city had been twisted into the form of the Big Dipper for astrological reasons, and also to follow the bank of the Wei River. The eight avenues divided the city into nine districts. These nine main districts were subdivided into 160 walled 1×1 li wards. About 50-100 families lived in each ward. Historically, Chang'an grew in four phases: the first from 200-195 BC when the palaces were built; the second 195-180 BC when the outer city walls were built; the third between 141-87 BC with a peak at 100 BC; and the fourth from 1 BC-24 AD when it was destroyed.
The Xuanpingmen gate was the main gate between the city and suburbs. The district north of the Weiyang Palace was the most exclusive. The main market, called the Nine Markets, was the eastern economic terminus of the Silk Road. Access to the market was from the Northeast and Northwest gates, which were the most heavily used by the common people. The former connect with a bridge over the Wei River to the northern suburbs and the latter connected with the rest of China to the east. An intricate network of underground passages connected the imperial harem with other palaces and the city. These passages were controlled by underground gatehouses and their existence was unknown.
In 200 BC after marking the boundaries of the three prefectures, which comprised the metropolitan region of Xianyang, Liu Bang appointed Xiao He to design and build the new capital. He chose to site the city on ruins of the Qin Dynasty Apex Temple (formerly, Xin Palace). This old Qin palace was meant to be the earthly mirror of Polaris, the apex star, where the heavenly emperor resided. This site, thus represented the center of the earth lying under the center of heaven with an axis mundi running upward from the imperial throne to its heavenly counterpart. The ruins were greatly expanded to 7×7 li in size and renamed Changle Palace (长乐宫; 長樂宮; Chánglè Gōng). Two years later, a new palace called Weiyang Palace (未央宮; Wèiyāng Gōng) was constructed 5×7 li. Prime minister Xiao He convinced Liu Bang that both the excessive size and multiplicity of palaces was necessary to secure his rule by creating a spectacle of power.
In 195 BC, his son, Emperor Hui of Han began the construction of the walls of Chang'an and finished them in September 191 BC. The grid north of the palaces was built at this time with a 2° difference in alignment to the grid of the palaces. The city remained quite static after this expansion.
Wu-ti began a third phase of construction which peaked on 100 BC with the construction of many new palaces. He also added the nine temples complex south of the city, and built the park. In 120 BC, Shanglin Park, which had been used for agriculture by the common people since Liu Bang was sealed off, was turned into an imperial park again. In the center of the park was a recreation of the three fairy islands in Kunming Lake.
Chang'an was briefly the capital of the Western Jin dynasty from 312 to 316. It was also the capital of Former Zhao (318–329), Former Qin (351–385) and Later Qin (384–417). In 417, a century after the Western Jin lost Chang'an, the city reconquered by Liu Yu of Eastern Jin, who founded the Liu Song dynasty in 420. The city was lost to Northern Wei by 439. When Northern Wei split in two, Chang'an became the capital of Western Wei (535–557), and also of its successor state Northern Zhou (557–581).
Both Sui and Tang empires occupied the same location. In 582, Emperor Wen of the Sui dynasty sited a new region southeast of the much ruined Han Dynasty Chang'an to build his new capital, which he called Daxing (大興, “Great Prosperity”). Daxing was renamed Chang'an in year 618 when the Duke of Tang, Li Yuan, proclaimed himself the Emperor Gaozu of Tang. Chang'an during the Tang dynasty (618–907) was, along with Constantinople (Istanbul) and Baghdad, one of the largest cities in the world. It was a cosmopolitan urban center with considerable foreign populations from other parts of Asia and beyond. This new Chang'an was laid out on a north–south axis in a grid pattern, dividing the enclosure into 108 wards and featuring two large marketplaces, in the east and west respectively. Every day, administrators of the two marketplaces would beat gongs three hundred times in the morning and evening to signify the start and stop of business. People who lived in the wards were not allowed to go outside after curfew. Officials with higher ranking had the privilege to live closer to the central avenue. Chang'an's layout influenced the city planning of several other Asian capitals for many years to come. Chang'an's walled and gated wards were much larger than conventional city blocks seen in modern cities, as the smallest ward had a surface area of 68 acres, and the largest ward had a surface area of 233 acres (0.94 km2). The height of the walls enclosing each ward were on average 9 to 10 ft (3.0 m) in height. The Japanese built their ancient capitals, Heijō-kyō (today's Nara) and later Heian-kyō or Kyoto, modeled after Chang'an in a more modest scale, yet was never fortified. The modern Kyoto still retains some characteristics of Sui-Tang Chang'an. Similarly, the Korean Silla dynasty modeled their capital of Gyeongju after the Chinese capital. Sanggyeong, one of the five capitals of the state of Balhae, was also laid out like Chang'an.
Much of Chang'an was destroyed during its repeated sacking during the An Lushan Rebellion and several subsequent events. Chang'an was occupied by the forces of An Lushan and Shi Siming, in 756; then taken back by the Tang government and allied troops in 757. In 763, Chang'an was briefly occupied by the Tibetan Empire. In 765, Chang'an was besieged by an alliance of the Tibetan Empire and the Uyghur Khaganate. Several laws enforcing segregation of foreigners from Han Chinese were passed during the Tang dynasty. In 779, the Tang dynasty issued an edict which forced Uighurs in the capital, Chang'an, to wear their ethnic dress, stopped them from marrying Chinese females, and banned them from pretending to be Chinese. Between 783 and 784, Chang'an was again occupied by rebels during the Jingyuan Rebellion (涇原兵變). In 881, Chang'an was occupied by Huang Chao. In 882, the Tang dynasty briefly regained control of Chang'an. However, the Tang forces, although welcomed by the inhabitants, looted Chang'an before being driven back by the forces of Huang Chao. In revenge, Huang Chao conducted a systematic slaughter of the inhabitants after retaking the city. Chang'an was finally retaken by the Tang government in 883. However, in 904, Zhu Quanzhong ordered the city's buildings demolished and the construction materials moved to Luoyang, which became the new capital. The residents, together with the emperor Zhaozong, were also forced to move to Luoyang. Chang'an never recovered after the apex of the Tang dynasty, but there are some monuments from the Tang era still standing.
After Zhu Quanzhong moved the capital to Luoyang, Youguojun (佑國軍) was established in Chang'an, with Han Jian being the Youguojun Jiedushi (佑國軍節度使). Han Jian rebuilt Chang'an on the basis of the old Imperial City. Much of Chang'an was abandoned and the rebuilt Chang'an, called "Xincheng (lit. new city)" by the contemporary people, was less than 1/16 of the old Chang'an in area.
During Tang, the main exterior walls of Chang'an rose 18 ft (5.5 m) high, were 5 miles (8.0 km) by six miles in length, and formed a city in a rectangular shape, with an inner surface area of 30 square miles (78 km2). The areas to the north that jutted out like appendages from the main wall were the West Park, the smaller East Park, and the Daming Palace, while the southeasternmost extremity of the main wall was built around the Serpentine River Park that jutted out as well. The West Park walled off and connected to the West Palace (guarded behind the main exterior wall) by three gates in the north, the walled-off enclosure of the Daming Palace connected by three gates in the northeast, the walled-off East Park led in by one gate in the northeast, and the Serpentine River Park in the southeast was simply walled off by the main exterior wall, and open without gated enclosures facing the southeasternmost city blocks. There was a Forbidden Park to the northwest outside of the city, where there was a cherry orchard, a Pear Garden, a vineyard, and fields for playing popular sports such as horse polo and cuju (ancient Chinese football). On the northwest section of the main outer wall there were three gates leading out to the Forbidden Park, three gates along the western section of the main outer wall, three gates along the southern section of the main outer wall, and three gates along the eastern section of the main outer wall. Although the city had many different streets and roads passing between the wards, city blocks, and buildings, there were distinct major roads (lined up with the nine gates of the western, southern, and eastern walls of the city) that were much wider avenues than the others. There were six of these major roads that divided the city into nine distinct gridded sectors (listed below by cardinal direction). The narrowest of these streets were 82 ft (25 m) wide, those terminating at the gates of the outer walls being 328 ft (100 m) wide, and the largest of all, the Imperial Way that stretched from the central southern gate all the way to the Administrative City and West Palace in the north, was 492 ft (150 m) wide. Streets and roads of these widths allowed for efficient fire breaks in the city of Chang'an. For example, in 843, a large fire consumed 4,000 homes, warehouses, and other buildings in the East Market, yet the rest of the city was at a safe distance from the blaze (which was largely quarantined in East Central Chang'an). The citizens of Chang'an were also pleased with the government once the imperial court ordered the planting of fruit trees along all of the avenues of the city in 740.
Within the West Park was a running stream and within the walled enclosure of the West Palace were two running streams, one connecting three ponds and another connecting two ponds. The small East Park had a pond the size of those in the West Palace. The Daming Palace and the Xingqing Palace (along the eastern wall of the city) had small lakes to boast. The Serpentine River Park had a large lake within its bounds that was bigger than the latter two lakes combined, connected at the southern end by a river that ran under the main walls and out of the city.
There were five transport and sanitation canals running throughout the city, which had several water sources, and delivered water to city parks, gardens of the rich, and the grounds of the imperial palaces. The sources of water came from a stream running through the Forbidden Park and under the northern city wall, two running streams from outside the city in the south, a stream that fed into the pond of the walled East Park, which in turn fed into a canal that led to the inner city. These canal waterways in turn streamed water into the ponds of the West Palace; the lake in the Xingqing Palace connected two canals running through the city. The canals were also used to transport crucial goods throughout the city, such as charcoal and firewood in the winter.
:For different buildings and locations in the entire city, the total numbers for each were
The once prosperous Tang capital abruptly declined after the end of the Tang Dynasty. In 880, the rebel Huang Chao sacked the city, destroying much of it.  When the warlord Zhu Quanzhong attacked the city again 25 years later, the capital was moved from Chang'an to Luoyang, and much of the city was abandoned and fell into disrepair.  Soon, the entire city was overrun by nature and was used for agriculture.