Shanghai is a direct-administered municipality and the most populous urban area in China. The city is located on the Chinese shoreline on the southern estuary of the Yangtze River, with the Huangpu River flowing through it. The population of the city proper is the second largest in the world with around 24.87 million inhabitants in 2023, while the urban area is the most populous in China, with 29.87 million residents. As of 2022, the Greater Shanghai metropolitan area was estimated to produce a gross metropolitan product (nominal) of nearly 13 trillion RMB ($1.9 trillion). Shanghai is one of the world's major centers for finance, business and economics, research, science and technology, manufacturing, transportation, tourism, and culture. The Port of Shanghai is the world's busiest container port.
Originally a fishing village and market town, Shanghai grew to global prominence in the 19th century due to domestic and foreign trade and its favorable port location. The city was one of five treaty ports forced to open to trade with the Europeans after the First Opium War, with the Shanghai International Settlement and French Concession subsequently established. The city became a primary commercial and financial hub of Asia in the 1930s. During the Second World War, it was the site of the Battle of Shanghai. This was followed by the Chinese Civil War with the Communists taking over the city and most of the mainland. During the Cold War, trade was mostly limited to other socialist countries in the Eastern Bloc, causing the city's global influence to decline.