War broke out when Chinese junks attempted to turn back English merchant vessels in November of 1839; although this was a low-level conflict, it inspired the English to send warships in June of 1840. The Chinese, with old-style weapons and artillery, were no match for the British gunships, which ranged up and down the coast shooting at forts and fighting on land. The Chinese were equally unprepared for the technological superiority of the British land armies, and suffered continual defeats. Finally, in 1842, the Chinese were forced to agree to an ignomious peace under the Treaty of Nanking.
The treaty imposed on the Chinese was weighted entirely to the British side. Its first and fundamental demand was for British "extraterritoriality"; all British citizens would be subjected to British, not Chinese, law if they committed any crime on Chinese soil. The British would no longer have to pay tribute to the imperial administration in order to trade with China, and they gained five open ports for British trade: Canton, Shanghai, Foochow, Ningpo, and Amoy. No restrictions were placed on British trade, and, as a consequence, opium trade more than doubled in the three decades following the Treaty of Nanking. The treaty also established England as the "most favored nation" trading with China; this clause granted to Britain any trading rights granted to other countries. Two years later, China, against its will, signed similar treaties with France and the United States.
Lin Tse-hsü was officially disgraced for his actions in Canton and was sent to a remote appointment in Turkestan. Of all the imperial officials, however, Lin was the first to realize the momentuous lesson of the Opium War. In a series of letters he began to agitate the imperial government to adopt Western technology, arms, and methods of warfare. He was first to see that the war was about technological superiority; his influence, however, had dwindled to nothing, so his admonitions fell on deaf ears.
It wasn't until a second conflict with England that Chinese officials began to take seriously the adoption of Western technologies. Even with the Treaty of Nanking, trade in Canton and other ports remained fairly restricted; the British were incensed by what they felt was clear treaty violations. The Chinese, for their part, were angered at the wholesale export of Chinese nationals to America and the Caribbean to work at what was no better than slave labor. These conflicts came to a head in 1856 in a series of skirmishes that ended in 1860. A second set of treaties further humiliated and weakened the imperial government. The most ignominious of the provisions in these treaties was the complete legalization of opium and the humiliating provision that allowed for the free and unrestricted propagation of Christianity in all regions of China.