Song dynasty
In 1089, another renowned poet governor Su Shi (Su Dongpo) used 200,000 workers to construct a 2.8 km (1.7 mi) long causeway across West Lake made of mud dredged from the lake bottom. The lake is surrounded by hills on the northern and western sides. The Baochu Pagoda sits on the Baoshi Hill to the north of the lake.
Hangzhou was chosen as the new capital of the Southern Song dynasty in 1132, when most of northern China had been conquered by the Jurchens in the Jin–Song wars. The surviving imperial family had retreated south from its original capital in Kaifeng after it was captured by the Jurchens in the Jingkang Incident of 1127. Emperor Gaozong moved to Nanjing, then to modern Shangqiu, then to Yangzhou in 1128, and finally to Hangzhou in 1129.
Once the prospect of retaking northern China had diminished, buildings in Hangzhou were extended and renovated to become a permanent imperial capital. The imperial palace in Hangzhou, modest in size, was expanded in 1133 with new roofed alleyways, and in 1148 with an extension of the palace walls. The city walls were built with tamped earth and stone and was 30 feet high and 10 feet thick at its base. There were 13 gates and several towers on the walls. The walls covered the city by four miles north to south and only one mile east to west. Arab merchants lived in Hangzhou during the Song dynasty, due to the fact that the oceangoing trade passages took precedence over land trade during this time. The Phoenix Mosque was constructed by a Persian settler in Hangzhou at this time.
From 1132 until the Mongol invasion of 1276, Hangzhou remained the capital of the Southern Song dynasty and was known as Lin'an (臨安). It served as the seat of the imperial government, a center of trade and entertainment, and the nexus of the main branches of the civil service. During that time the city was a gravitational center of Chinese civilization as what used to be considered "central China" in the north was taken by the Jin, an ethnic minority dynasty ruled by Jurchens.
Numerous philosophers, politicians, and men of literature, including some of the most celebrated poets in Chinese history such as Su Shi, Lu You, and Xin Qiji came here to live and die. Hangzhou is also the birthplace and final resting place of the scientist Shen Kuo (1031–1095 AD), his tomb being located in the Yuhang district.
During the Southern Song dynasty, commercial expansion, an influx of refugees from the conquered north, and the growth of the official and military establishments, led to a corresponding population increase and the city developed well outside its 9th-century ramparts. According to the Encyclopædia Britannica, Hangzhou had a population of over 2 million at that time, while historian Jacques Gernet has estimated that the population of Hangzhou numbered well over one million by 1276. (Official Chinese census figures from the year 1270 listed some 186,330 families in residence and probably failed to count non-residents and soldiers.) It is believed that Hangzhou was the largest city in the world from 1180 to 1315 and from 1348 to 1358.
Because of the large population and densely crowded (often multi-story) wooden buildings, Hangzhou was particularly vulnerable to fires. Major conflagrations destroyed large sections of the city in 1208, 1229, 1237, and 1275. The 1237 fire alone destroyed 30,000 dwellings. However, the worst was the 1208 fire which burned for 4 days in a 3-mile diameter and burnt 58,097 houses as well as killing 59 people. To combat this threat, the city constructed storage buildings that were rented out to merchants where watchmen patrolled by night and was enclosed by water on all sides. Besides this, the government established an elaborate system for fighting fires, erected watchtowers, devised a system of lantern and flag signals to identify the source of the flames and direct the response, and charged more than 3,000 soldiers with the task of putting out fire.