<P> The Treaty of Nanking , the Supplementary Treaty of the Bogue , and two French and American agreements were all `` unequal treaties '' signed between 1842 and 1844 . The terms of these treaties undermined China 's traditional mechanisms of foreign relations and methods of controlled trade . Five ports were opened for trade , gunboats , and foreign residence : Guangzhou , Xiamen , Fuzhou , Ningbo , and Shanghai . Hong Kong was seized by the British to become a free and open port . Tariffs were abolished thus preventing the Chinese from raising future duties to protect domestic industries and extraterritorial practices exempted Westerners from Chinese law . This made them subject to their own civil and criminal laws of their home country . Most importantly , the opium problem was never addressed and after the treaty was signed opium addiction doubled . China was forced to pay 21 million silver taels as an indemnity , which was used to pay compensation for the traders ' opium destroyed by Commissioner Lin . A couple of years after the treaties were signed internal rebellion began to threaten foreign trade . Due to the Qing government 's inability to control collection of taxes on imported goods , the British government convinced the Manchu court to allow Westerners to partake in government official affairs . By the 1850s the Chinese Maritime Customs Service , one of the most important bureaucracies in the Manchu Government , was partially staffed and managed by Western Foreigners . In 1858 opium was legalised , and would remain a problem . </P>
what commodity ultimately led to british gaining control of hong kong in the treaty of nanjing
opium