The site has been inhabited since Neolithic times, during which the Yangshao culture was established in Banpo, in what is now the city's suburbs.
[1][2] 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.
[4] This population consisted mostly of the scholar gentry class whose education was being sponsored by their wealthy aristocratic families.
Initially, Emperor Liu Bang decided to build his capital at the area south of Luo River, which according to Chinese geography was in modern Luoyang.
To this end, it is recorded c 200 BC he forcibly relocated thousands of clans in the military aristocracy to this region.
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.
[4] During the reign of Emperor Wu of Han, the diplomat Zhang Qian was dispatched westward into Central Asia.
Subsequently, Chang'an city became the Asian gateway to Europe as the point of departure of the Silk Road.
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.
The entire city was sited below the 400 m contour line which the Tang dynasty used to mark the edge of the floodplain.
[4] Twelve gates with three gateways each, according with the ritual formulas of Zhou dynasty urban planning, pierced the wall.
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.
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.
The ruins were greatly expanded to 7×7 li in size and renamed Changle Palace (长乐宫; 長樂宮; Chánglègōng).
[4] 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.
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.
[9] 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.
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).
[14] There were six of these major roads that divided the city into nine distinct gridded sectors (listed below by cardinal direction).
[15] 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.
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 904, the warlord Zhu Quanzhong ordered the city's buildings demolished and the construction materials moved to Luoyang, which became the new capital.
After Zhu Quanzhong moved the capital to Luoyang, the Youguo Governorate (佑國軍) was established in Chang'an, with Han Jian being the jiedushi (佑國軍節度使).