Canton, in conjunction with Macao, was the only port opened to Europeans for trade. Prior to 1759 Europeans were relatively free to trade, proselytise and live within the Ming and Qing empires after they first came to China via the sea routes in the early sixteenth century.
Five treaty ports were opened in accord with the Treaty of Nanjing, signed following the defeat of the First Opium War (1839-1842). This marks a new era of Sino-western relationships: Qing China could not run the empire in its own way any longer in the globalising world.
A further ten port cities were signed away to become treaty ports in the Treaty of Tianjin during the Second Opium War (1856-1860).
Tianjin was opened to the westerners according to the Treaty of Beijing, which witnessed the end of the Second Opium War.
Between 1860 and 1902 the nine concession zones (or as the Chinese called it the “renting zones, zujie租界”) were set up in Tianjin one-by-one by the imperialists. Between 1919 and 1945, the concession zones were returned to the Chinese in the aftermath of the two world wars.
The Tianjin old city was still ruled by the Chinese and so were the areas surrounding the nine concession zones, while within the nine concession zones the foreigners had full autonomy. After the Qing Dynasty (1644-1911) was overthrown, Tianjin Municipality was under several different governments amidst the civil unrest and the WWII :