of foreign merchants from Dejima to Nagasaki and of Japanese from Nagasaki to Dejima. Similarly, the island of Macau was ceded by China during the Ming dynasty to the Portuguese, who administered it as a trading hub between 1557 and 1999. In the aftermath of the Opium Wars, the Ming Dynasty's successor Qing Dynasty ceded the island of Hong Kong and the surrounding area to the British under the Treaty of Nanjing, resulting in the area being administered as a British trading hub until 1997. During the late Qing years, significant portions of Chinese territory, primarily along the coast, were surrendered as concessions to occupying powers including many European powers as well as Japan and the United States. Each concession had its own police force, and different legal jurisdictions with their own separate laws. Thus, an activity might be legal in one concession but illegal in another. Many of the concessions also maintained their own military garrison and standing army. Military and police forces of the Chinese government were sometimes present. Some police forces allowed Chinese, others did not. In these concessions, the citizens of each foreign power were given the right to freely inhabit, trade, proselytize, and travel. They developed their own sub-cultures, isolated and distinct from the intrinsic Chinese culture, and colonial administrations attempted to give their concessions "homeland" qualities. Churches, public houses, and various other western commercial institutions sprang up in the concessions. In the case of Japan, its own traditions and language naturally flourished. Some of these concessions eventually had more advanced architecture of each originating culture than most cities back in the countries of the foreign powers origin. Chinese were originally forbidden from most of the concessions, but to improve commercial activity and services, by the 1860s most concessions permitted Chinese, but treated them like second-class citizens as they were not citizens of the foreign state administering the concession. They eventually became the majority of the residents inside the concessions. Non-Chinese in the concessions were generally subject to consular law, and some of these laws applied to the Chinese residents. Notable Concessions include the Shanghai International Settlement administered by the United Kingdom and the United States, the French Concession in Shanghai , the Kwantung Leased Territory, and the Beijing Legation Quarter. The foreign concessions in China continued to exist during the mainland period of the Republic of China. In major cities like Shanghai and Tianjin,