The Opium Wars were two wars in the mid-19th century involving Anglo-Chinese disputes over British trade in China (prominently the opium trade, where they get their names from) and China's sovereignty. The disputes included the First Opium War (1839–1842) and the Second Opium War (1856–1860). The wars and events between them weakened the Qing dynasty and forced China to trade with the other parts of the world.
The First Opium War, during 1839–1842, was concluded by the Treaty of Nanjing in 1842. The treaty ceded the Hong Kong island to the United Kingdom in perpetuity, and it established five treaty ports at Shanghai, Canton, Ningpo, Fuchow, and Amoy. Another treaty the next year gave most favored nation status to the United Kingdom and added provisions for British extraterritoriality. Then France secured concessions on the same terms as the British, in treaties of 1843 and 1844.
During 1856–1860, British forces fought towards legalisation of the opium trade, to expand coolie trade, to open all of China to British merchants, and to exempt foreign imports from internal transit duties. France joined the British. The war is also known as the "Arrow War", referring to the name of a vessel at the starting point of the conflict. The war resulted in a second group of treaty ports being set up; eventually more than 80 treaty ports were established in China, involving many foreign powers. All foreign traders gained rights to travel within China.