By the beginning of the nineteenth century, opium addiction was pervasive among the Chinese population, and attempts by the government to restrict the opium trade caused the two Opium wars (1840 to 1842 and 1856 to 1860), won by the British and their Western allies. As a result of these wars, an epidemic of opium addiction quickly spread to affect over 25% of the Chinese population.