The history of Shanghai spans over a thousand years and closely parallels the development of modern China. Originally a small agricultural village, Shanghai developed during the late Qing dynasty (1644–1912) as one of China's principal trading ports. Although nominally part of China, in practice foreign diplomats controlled the city under the policy of extraterritoriality. Since the economic reforms of the early 1990s the city has burgeoned to become one of Asia's major financial centers and the world's busiest container port.

Early Era

Around 6000 BCE, only the western part of the Shanghai region encompassing today's Qingpu, Songjiang and Jinshan districts were dry land formed by lacustrine silting from ancient Lake Tai. The modern Jiading, Minhang and Fengxian districts emerged around 1,000 BC while the downtown area remained underwater.

History of Shanghai

The earliest Neolithic settlements known in this area date to the Majiabang culture (50003300 BCE). This was overlapped by the Songze culture between around 3800–3300 BCE. In the lower stratum of the Songze excavation site in the modern-day Qingpu District, archaeologists found the prone skeleton of one of the Shanghai's earliest inhabitantsa 25-30-year-old male with an almost complete skull dated to the Majiabang era.

History of Shanghai

By the 4th and 5th centuries CE, during the Eastern Jin dynasty (317420), a thriving fishing industry had developed along the Song Rivernow known as Suzhou Creek,a tributary of the Huangpu River. Located some from the Yangtze River estuary, China's largest inland waterway, the creek was at that time known as the Hu (), a character that represents a fishing trap, of which there were a number in the river. The character Hu is still used as an abbreviation to denote the city, for example on car license plates. Qinglong Zhen (), the "Garrison of the Green Dragon", the first garrison in this area, was founded in 746 during the Tang dynasty (618–907) in what is now the Qingpu District of Shanghai. Five years later, Huating Zhèn () followed, demonstrating the growth of the region and its increasing political and geographical importance.

History of Shanghai

In 1074, Emperor Shenzong of Song, established a Marine Office and a Goods Control Bureau north-west of Huating Zhen at the approximate location of Shanghai's old city, adjacent to a ditch or pu () that ran north into Suzhou Creek and allowed for the loading and unloading of freight.

Later on, the area's proximity to Hangzhou, the capital of the Southern Song dynasty (1127-1279), proved beneficial. Along with its commercial activities, Qinglong Zhen became a military and naval base and by the early 12th century a Superintendent of Foreign Trade was established in the settlement to supervise trade and tax collections across five counties. As a result, the flourishing and prosperous town earn the sobriquet "Little Hangzhou."

According to official government sources, Shanghai first became a city in 1291 during the Yuan dynasty (1271–1368). At this time, five of Huating Zhen's villages were amalgamated to form a new Shanghai County () on the site of the modern city centre. This new settlement had a population of about 300,000 with many engaged in the shipping trade.

Ming dynasty

By the early 15th century, Shanghai had become important enough for Ming dynasty engineers to begin dredging the Huangpu River (also known as Shen). In 1553, a city wall was built around the Old Town (Nanshi) as a defense against the depredations of the Wokou (Japanese pirates). Shanghai had its first contact with the Jesuits in 1603 when the Shanghai scholar-bureaucrat Xu Guangqi was baptized by Jesuit priest Matteo Ricci. Xu later bequeathed some of his land in Shanghai, today's Xujiahui, meaning Xu family village, to the Catholic Church. By the end of the Ming dynasty in 1644, Shanghai had become a major cotton and textile center with a population that would soon reach 200,000.

Qing dynasty

During the late Qing dynasty, Shanghai's economy began to rival that of the traditionally larger market at Suzhou. In the 18th and early 19th centuries, exports of cotton, silk, and fertilizer reached as far as Polynesia and Persia.