The spread of Christian missionary activity in China was directly associated with China's military humiliation in the 19th century, as a result of which the interior of the country was opened to foreigners. The missions offered medical support, particularly in ameliorating the worst effects of opium addiction, thereby gaining converts. This was perceived as the height of duplicity by Chinese officials, who also understood Christian teaching to be a direct attack on Confucianism.
The culmination of the distrust the Chinese felt for foreigners came in the form of the attacks perpetrated by the ‘Boxers', rural nationalist groups formed into militias. Beginning as attacks on Christian missions in several cities in the north of China, the unrest graduated, with the support of the authorities, to attacks on all foreigners, particularly in Peking, where the foreign legations were besieged in 1900.
By this time the imperial government was corrupt and, weakened by the repeated incursions of foreigners, unable to defend itself against western military arsenals. The military attack and unequivocal victory in Peking of the combined foreign forces in response to the Boxer Uprising, was devastating, and led to a punitive peace protocol and contributed to the ultimate collapse of the Empire in 1911.