The British and the Chinese engaged in two separate wars with each other over the opium trade during the Opium Wars. At the beginning of the nineteenth century, the British began sending significant quantities of opium from India to China. As a result, there was a significant rise in the prevalence of addiction in China, and the government there attempted to prevent the British from importing the substance. In 1839, the British attacked China with gunboats and coerced the Chinese into giving them Hong Kong and legalizing opium as a result of the attack. The Opium Wars were fought between China and Britain and ended in 1842 and 1856 respectively.