The Chinese fought to stop those sales, which led to the First Opium War, in which the technologically superior British Navy defeated the Chinese in 1839–42, leading Britain to impose a treaty that gave the British Hong Kong and opened up a number of Chinese ports, most notably Shanghai, to traders from Britain (as well as other powers in subsequent treaties), which eventually led to the loss of large parts of northern China to Russia and Japan and the loss of what we now call Taiwan to Japan.