The Eight-Nation Alliance advanced to Beijing, initially led by British naval commander Seymour, advancing steadily. Although they faced a few minor setbacks along the way, the losses were minor. Upon reaching Yangcun, they found themselves surrounded by the Boxers. Outnumbered and caught in a difficult position, they nearly suffered total annihilation. Later, they took a detour back to Tianjin and seized the Eastern Bureau of the Qing government, which allowed their morale to recover. By this time, the troops from various countries had gathered. Due to many of his soldiers being sick, Seymour's forces took a temporary rest. On August 4th in the Gregorian calendar, which corresponds to the 10th of the 7th month in the lunar calendar, the commanders of the allied nations received a plea for help from the embassy, and that day they united to launch a large-scale attack. They advanced along multiple routes, moving quickly, and five days later occupied Beicang, followed by the recapture of Yangcun. The Qing army commander Yushou was unable to resist and retreated, unable to mount a defense, ultimately being killed by cannon fire in Caicun. The morale of the allied forces soared, advancing with unstoppable momentum.

At this point, Li Jian was ordered to oversee the troops and had just arrived at Hexiwu when the foreign troops launched a massive assault. Before he could set up defenses, the armies of Zhang Chunfa and Chen Zelin were already in disarray. Seeing the troops lacking in fighting spirit and knowing the situation was dire, Li Jian took his own life. By this time, Ma Yukun had already led his troops into the city. The allied forces pursued victoriously, pressing towards Tongzhou; the Japanese soldiers, known for their bravery in battle, took the lead; the British, Russian, French, and American troops followed closely behind, but encountered little to no resistance.

On July 19th, the allied forces approached the city of Beijing, using large wooden frames to set up cannons and bombarding the city with cannon fire. The shells flew through the air, falling like a torrential rain. It is unknown how many houses were struck by cannon fire; the soldiers and civilians either fell to the ground or lost their lives, their cries echoing through the heavens.

Thirteen cannons were fired in succession, and a general from a certain country, fearing harm to the common people, displayed heavenly compassion and strongly advised against it; this brought the matter to an end. Then everyone set up camp in their respective areas and discussed plans, deciding to launch their attacks on their designated sections the next morning. As a result, the Russians, eager for achievement, stealthily attacked the East City at midnight, hoping to be the first to break in. The Japanese, upon learning this, also launched a stealthy attack, fighting desperately through the night, breaching the Dongzhimen and Qihuamen gates. The Anglo-American allied forces approached from the south and advanced towards Baoding by land. Ting Yong, the governor of Zhili, along with officials and common people, surrendered, and the various commanders captured Ting Yong. According to Chinese law, they conducted a trial in the main hall, forcing Ting Yong to kneel and questioning him about his collusion with bandits and the animosity he had incited. Ting Yong repeatedly defended himself, but no one listened, and in the end, he was executed by firing squad in accordance with Western practices.

In Beijing, besides the countless common people who perished, many officials committed suicide to preserve their honor, and entire families took their own lives, and the exact number remains unknown. Corpses of men in official robes and women in beautiful clothes were everywhere, a truly shocking sight. Many of those who hanged themselves had ropes tied high, and no one came to untie them for a long time. Over time, their necks broke, leaving their heads still hanging above, making passersby feel a deep sorrow. Even Zhang Zhiwan, the minister at the time, whose home was also in Beijing, was robbed as well, and later, Minister Li sent someone to check on the remaining items, only to discover that nothing remained.