Antiquity The western part of modern-day Shanghai was inhabited 6,000 years ago. During the
Spring and Autumn period (approximately 771 to 476 BC), it belonged to the
Kingdom of Wu, which was conquered by the
Kingdom of Yue, which in turn was conquered by the Kingdom of Chu. During the
Warring States period (475 BC), Shanghai was part of the fief of
Lord Chunshen of Chu, one of the
Four Lords of the Warring States. Local legends claim he ordered the excavation of the
Huangpu River, an important river in the area. Its former or poetic name, the Chunshen River, gave Shanghai its nickname of "Shēn".
Imperial era During the Tang and Song dynasties, Qinglong Town () in modern
Qingpu District was a major trading port. Established in 746, it developed into what was historically called a "giant town of the Southeast". The port experienced thriving trade with provinces along the
Yangtze and the Chinese coast, as well as foreign countries such as Japan and
Silla. By the end of the
Song dynasty, the center of trading had moved downstream of the
Wusong River to Shanghai. Its status was upgraded from a village to a market town in 1074; in 1172, a second sea wall was built to stabilize the ocean coastline, supplementing an earlier dike. From the
Yuan dynasty in 1292 until Shanghai officially became a
municipality in 1927, central Shanghai was administered as a county under
Songjiang Prefecture, which had its seat in the present-day
Songjiang District. in the 17th century Shanghai's first
city wall was built in 1554 to protect the town from raids by
Japanese pirates. It was high and in circumference. A
City God Temple was built in 1602 during the
Wanli reign. This honor was usually reserved for prefectural capitals and not normally given to a county seat like Shanghai. Scholars theorized that this reflected the town's economic importance. During the
Qing dynasty, two central government policy changes caused Shanghai to become one of the most important seaports in the
Yangtze Delta region. The first was in 1684, when the
Kangxi Emperor reversed the 1525 prohibition on oceangoing vessels. In 1732, the
Qianlong Emperor moved the customs office for
Jiangsu province (; see
Customs House, Shanghai) from
Songjiang to Shanghai, and gave Shanghai exclusive control over customs collections for Jiangsu's foreign trade. Shanghai became the major trade port for the lower Yangtze region by 1735, despite being at the lowest administrative level in the political hierarchy. In the 19th century, international attention and recognition of its economic and trade potential at the
Yangtze grew. British forces occupied the city during the
First Opium War. The war ended in 1842 with the
Treaty of Nanking, which opened Shanghai as one of the five
treaty ports for international trade. The
Treaty of the Bogue, the
Treaty of Wanghia, and the
Treaty of Whampoa, signed between 1843 and 1844, forced Chinese concession to European and American desires for visitation and trade in China. Britain, France, and the
United States established a presence outside the walled city of Shanghai, which remained under the direct administration of the Chinese. The Chinese-held Old City of Shanghai fell to rebels from the
Small Swords Society in 1853, but was regained by the Qing government in February 1855. In 1854, the
Shanghai Municipal Council was created to manage the foreign settlements. Between 1860 and 1862, the
Taiping rebels twice attacked Shanghai and destroyed the city's eastern and southern suburbs, but failed to take the city. In 1863, the British settlement south of
Suzhou Creek (northern
Huangpu District) and the American settlement to the north (southern
Hongkou District) joined to form the
Shanghai International Settlement. The French opted out of the
Shanghai Municipal Council and maintained
its own concession at the city's south and southwest. The
First Sino-Japanese War concluded with the 1895
Treaty of Shimonoseki, which elevated Japan as another foreign power in Shanghai. Japan built the first factories in Shanghai, which were copied by other foreign powers. This international activity gave Shanghai the nickname "the Great
Athens of China".
Republic era as seen from the
French Concession in the 1920s In 1912, the Old City walls were dismantled as they blocked the city's expansion. In July 1921, the
Chinese Communist Party was founded in the
Shanghai French Concession. Workers in the city then launched
general strikes against
imperialism, which became nationwide protests that gave rise to
Chinese nationalism. , 1922 The golden age of Shanghai began with its elevation to municipality after it was separated from
Jiangsu on 7 July 1927. This new Chinese municipality was , and included the districts of
Baoshan,
Yangpu,
Zhabei,
Nanshi, and
Pudong. The city became a commercial and financial hub of the
Asia-Pacific region in the 1930s. During the ensuing decades, citizens of many countries immigrated to Shanghai; those who stayed for long periods called themselves "
Shanghailanders". In the 1920s and 1930s, almost 20,000
White Russians fled the newly established
Soviet Union to reside in Shanghai. These
Shanghai Russians constituted the second-largest foreign community. By 1932, Shanghai had become the world's fifth-largest city and home to 70,000 foreigners. In the 1930s, approximately 30,000 Jewish refugees from Europe arrived in the city.
Japanese invasion on fire, 1937|alt= On
28 January 1932, Japanese military forces invaded Shanghai. More than 10,000 shops and hundreds of factories and public buildings were destroyed, leaving Zhabei district ruined. About 18,000 civilians were either killed, injured, or declared missing. In 1937, the
Battle of Shanghai resulted in the occupation of the Chinese-administered parts of Shanghai outside of the International Settlement and the French Concession. People who stayed in the occupied city experienced hunger, oppression, or death. The foreign concessions were occupied by the Japanese on 8 December 1941 and remained occupied until Japan's surrender in 1945. Many Jewish people arrived in Shanghai during the Japanese occupation period. A vice-consul for Japan in Lithuania,
Chiune Sugihara, issued thousands of visas to Jewish refugees escaping the
Holocaust, and the Japanese government transferred many of them to Shanghai by November 1941. Other Jewish refugees traveled from Italy. The refugees from Europe were interned in the
Shanghai Ghetto in Hongkou District after the Japanese
attack on Pearl Harbor. After the
surrender of Japan, the Chinese Army liberated the Ghetto, and most of the Jews left over the next few years.
People's Republic era On 27 May 1949, the
People's Liberation Army took control of Shanghai through the
Shanghai Campaign. Under the new People's Republic of China (PRC), Shanghai was one of only three municipalities not merged into neighboring provinces (the others being
Beijing and
Tianjin). Most foreign firms moved their offices from Shanghai to
Hong Kong, as part of a foreign
divestment due to the PRC's victory. , 1967, during the
Cultural Revolution After the war, Shanghai's economy was restored. From 1949 to 1952, the city's agricultural and industrial output increased by 51.5% and 94.2%, respectively. During the
Cultural Revolution (1966–1976), Shanghai's society was severely damaged. The majority of the workers in the Shanghai branch of the
People's Bank of China were
Red Guards, and they formed a group called the Anti-Economy Liaison Headquarters within the branch. The Anti-Economy Liaison Headquarters dismantled economic organizations in Shanghai, investigated bank withdrawals, and disrupted regular bank service in the city. That year, the China's central government designated Shanghai as the "Dragon Head" of the
reform and opening up. In 2022, Shanghai experienced a large outbreak of
COVID-19 cases and the
Chinese government locked down the entire city on 5 April. This resulted in widespread food shortages across the city as food-supply chains were severely disrupted. These restrictions were lifted on 1 June. ==Geography==