By 1900 the Chinese empire had undergone many years of military defeat and humiliation at the hands of European, and then Japanese, forces. For a people accustomed to think of themselves as racially and culturally superior to any on earth, with a thousand year old civilisation, this was intolerable. Discontent made itself most apparent in the countryside, with the growth of The Society of Righteous and Harmonious Fists, or the "Boxers", so named by outsiders for their stress on physical exercises. The Boxers even believed themselves immune to bullets, a belief encouraged amongst the peasents by "proofs" using rigged guns. However bizarre the spiritual aspect of the movement might seem, it tapped into a genuine and widespread sense of grievance, and spread like wildfire through the country.
By Spring 1900 the Boxers were nearing Peking, leaving a trail of murdered Chinese Christians in their wake. They made no secret of their desire to murder every foreigner and Christian in China. Alarmed, and having little faith in the central government, the embassies in Peking asked permission to bring in soldiers from ships moored in Tianjin, the nearest port. With reluctant government agreement, over two days 400 Marines disembarked from warships in the harbour and more or less hijacked trains to Peking, with 11 coaches of troops and ammunition. Once they arrived there was a fraught 6 mile forced march to the Legations where they set about fortifying their respective embassies and the compound. In total the regular forces available were,
Great Britain (82), Russia (81), United States (56), Germany (51), France (48), Austria-Hungary (35), Italy (29), Japan (25)
As a way of isolated foreign influence, foreign embassies were restricted to the "Legation Quarter", a box about 2 miles long and 1 mile wide which in 1900 contained 11 embassies, as well as various foreign banks and businesses. One one side was the old Tartar wall, but the other edges were just bordered by streets and houses. It was not especially defensible, but barricades were built and every effort made. It was clear some embassies would have to be abandoned, they were just too vulnerable.
It is as well the troops arrived when they did, on June 5th the railway line to Tianjin was cut, Peking was isolated and on June 15th a Japanese diplomat was murdered by soldiers of the Chinese army. In fact the position of the central government was causing serious concern, as whilst the Dowager Empress had initially opposed the Boxers, she now seemed to coming round to the idea of using them as a way of getting rid of the hated foreigners. The situation was not helped by the German minister, Klemens Von Ketteler, whose troops captured and executed a Boxer boy. In response, thousands of Boxers stormed into the city, joined by Muslim "Kansu Braves" and burned churches through Peking. They attacked the legations, and were repulsed by gunfire by the British and Germans.
On June 19th the embassy staff were officially told to leave the country, but when the German, Klemens Von Ketteler, tried and was murdered by an army captain they decided they were safer where they were. On June 21st, the Empress declared war on all foreign powers and Imperial Chinese army troops joined the Boxers surrounding the Legation. The 473 foreign civilians, 409 soldiers, and about 3,000 Chinese Christians in the Legation Quarter were under siege.