<P> The First Opium War (Chinese: 第 一 次 鴉片 戰爭), also known as the Opium War or the Anglo - Chinese War, was a series of military engagements fought between the United Kingdom and the Qing dynasty of China over their conflicting viewpoints on diplomatic relations, trade, and the administration of justice in China . </P> <P> In the 17th and 18th centuries, the demand for Chinese goods (particularly silk, porcelain, and tea) in Europe created a trade imbalance between Qing Imperial China and Great Britain . European silver flowed into China through the Canton System, which confined incoming foreign trade to the southern port city of Canton . To counter this imbalance, the British East India Company began to auction opium grown in India to independent foreign traders in exchange for silver, and in doing so strengthened its trading influence in Asia . This opium was transported to the Chinese coast, where local middlemen made massive profits selling the drug inside China . The influx of narcotics reversed the Chinese trade surplus, drained the economy of silver, and increased the numbers of opium addicts inside the country, outcomes that worried Chinese officials . </P> <P> In 1839, the Daoguang Emperor, rejecting proposals to legalise and tax opium, appointed viceroy Lin Zexu to solve the problem by completely banning the opium trade (it had already been illegal to smoke and sell certain forms of opium in China since 1729) without offering compensation and ordered a blockade of foreign trade in Canton . Lin confiscated 20,283 chests of opium (approximately 1210 tons or 2.66 million pounds) after confining the foreign traders to the Canton Factories and cutting off their supplies . The British government did not question China's right to prohibit opium, but it objected to the way this was handled; it viewed the sudden strict enforcement as laying a trap for the traders, and the confinement of the British with their supplies cut off was tantamount to starving them into submission or death . They dispatched a military force to China and in the ensuing conflict, the Royal Navy used its naval and gunnery power to inflict a series of decisive defeats on the Chinese Empire, a tactic later referred to as gunboat diplomacy . </P> <P> In 1842, the Qing dynasty was forced to sign the Treaty of Nanking--the first of what the Chinese later called the unequal treaties--which granted an indemnity and extraterritoriality to Britain, opened five treaty ports to foreign merchants, and ceded Hong Kong Island to the British Empire . The failure of the treaty to satisfy British goals of improved trade and diplomatic relations led to the Second Opium War (1856--60), and the Qing defeat resulted in social unrest within China . In China, the war is considered the beginning of modern Chinese history . </P>

What was the cause of the armed conflict between great britain and china in 1840
find me the text answering this question