By the early 19th century, the Qing dynasty was suffering from administrative inertia, inadequate tax revenues and natural disasters. Then came a series of military defeats at the hands of foreign nations, beginning with the First Opium War with Great Britain in 1841.
These setbacks forced the Qing court to make many concessions, including the opening of the so-called treaty ports. This led not only to an expansion in foreign trade but also to unprecedented levels of cultural exchange. Missionaries arrived in large numbers, bringing Western education, medicine and technology.