In June, 1863, Imperial Chinese army General Bao Chao took Jiufu Island and the Taiping Army had lost the control of the entire northern shore of the Yangtze River, and Imperial general Bao Chao subsequently led his force across the Yangtze River and camped on the southern bank of Yangtze River outside the Shence Gate of Nanking. In September, 1863, Zeng Guofan's younger brother, a general of Imperial Army, General Zeng Guoquan led his force attacked and took Upward Bridge region to the southeast of the city and Eastern Riverine Bridge region to the southwest of the city. General Zeng Guoquan continued his quest of suburbs of Nanking and by early November, 1863, and he succeeded in taking regions including Upward Gate , High Bridge Gate , Twin Bridge Gate , Seventh Bridge Jar , Muling Pass, and Central Peace Bridge . Taiping Army therefore lost all of its positions in the southwestern part of Purple Gold Mountain. By mid November, regions including Chunhua , Jiexi , Longdu , Hushu , Tree Branches Town fell under Imperial Chinese army's control. At the same time, the Imperial navy commanded by Imperial admiral Peng Yulin and his deputy, Yang Yuebin took important regions including Gaochun and Eastern Dam with the help of Imperial General Bao Chao 's forces. By late November, Taiping garrison at Lishui surrendered to Imperial Chinese army. As a result, Taiping army was evicted from the vast region within 50 miles of Nanking. On November 25, 1863, General Zeng Guoquan and his subordinate, general Xiao Qingyan deployed troops at Piety Tomb . The only links to the outside left were the Shengce Gate and Taiping Gate.
On December 20, 1863, Li Xiucheng returned to Nanking from Danyang and urged Hong Xiuquan to abandon the Taiping capital on the very next day. However, suggestion was not accepted by Hong Xiuquan, who took the overall command of the operation. Hong declared that anyone who disobeys him and God would be immediately executed. These foolish acts of Hong not only doomed the Taiping army and Nanking, but also created wide spread discontent, and coupled with other factors, eventually, over 200,000 Taiping troops went out of Nanking and surrendered to the Imperial Chinese army during the entire course of the battle. For those who refused to surrender but was also upset by Hong's foolish acts, they chose to break out while they still could, when the siege was still incomplete. Hong, Li and others were unable to stop such acts. On February 28, 1864, Tianbao Castle at the highest peak of Purple Gold Mountain fell under the imperial Chinese army's control. On March 2, 1864, Imperial general Zeng Guoquan deployed his troops to Shengce Gate and Taiping Gate, the siege of Nanking was completed.
On March 14, 1864, Imperial general Zeng Guoquan attempted his first attack on Nanking using ladders, but this first attempt was beaten back by the defenders. The imperial army then changed tactic by digging a total of ten underground tunnels at Chaoyang , Shence , and Jinchuan Gates, and the defenders in turn, countered with digging tunnels of their own and building a secondary wall behind the first. Five days after the death of Hong Xiuquan on June 1, 1864, Li Xiucheng was finally put in charge of all military and political affairs, but this was too late already, the fate of the city and its defenders were sealed.
On July 3, 1864, Dibao Castle on Purple Gold Mountain fell into Imperial Chinese army's hands. This strategic location enabled the Imperial Chinese army to build several dozen artillery positions to bombards the entire city, thus suppressing the defenders' firepower and providing cover for other preparations to take the city. One tactic of the attackers was to fill the space between the city wall and the mountain ridge at the Dragon's Neck with earth, sand, logs, rocks and grass, so the land surface was raised to the height of city wall, thus paving the way of attacking the city. Another tactic was to dig underground tunnel just 200 feet away from the city wall so that they could be filled with explosives to blow up the wall. Operations with such close proximity of the enemy fire was able to continue due to the sufficient covering fire, thanks to the taking of Dibao Castle. Defenders's attempt to disrupt the preparation was continuous beaten back with heavy loss due to heavy fire from attackers. Half a month later, the preparation was complete.
Realizing the final attack was coming, at the night of July 18, 1864, Li Xiucheng ordered more than a thousand defenders to disguise themselves as attackers to sneak out the city to destroy the tunnel, but the attackers were not fooled and successfully beaten back the thousand men formation. Next afternoon 13：00, the attackers detonated the explosives in the tunnel under Taiping Gate, the wall breaking fly 2--10 km far down, press several hundreds people die, and collapsed a large section of city wall. The defenders put a fierce fight, but was unable to drive back the attackers 60,000. The attackers were divided into four fronts after entering Nanking as previously planned:
*The central front led by imperial general Li Chenden attacked toward Hong Xiuquan's palace
*The right front led by imperial general 刘连捷 pushed toward Shence gate to link up with imperial general Zhu Nangui 's force who entered the gate via ladders, and after two teams had joined forces, they would attack westward toward Lion Mountain to take Yifeng Gate.
*The central-left front led by imperial general Peng Yuju attacked toward Tongji Gate.
*The left front led by imperial general Xiao Fusi attacked toward Chaoyang and Hongwu gates.
The street fight was fierce and bloody and the resistance was much tougher than expected and attackers' artillery cover had to stop for fearing injuring their own. Defenders were very stubborn and expected to inflicted heavy casualties on attackers and hoped to drive the attackers back outside the city.
After the fall of Chaoyang Gate, the defenders' morale collapsed and imperial general Luo Fengyan was able to lead his force to break into the city from Jubao Gate，while imperial general Li Jinzhou was able to break into the city from Gate, linking up with forces led by imperial general Peng Yuju . At the same time, Imperial admiral Huang Yisheng lead the imperial navy took Zhongguan and then took remaining fortresses still in the defenders' hands at the river banks, and helped imperial general Chen Ti take two Shuixi and Hanxi gates. By the evening, every gate of the city was firmly in the hands of attackers.
Li Xiucheng immediately returned to Hong Xiuquan's palace after the defeat at the Taiping Gate in the morning, and took Hong Xiuquan's son with him to escape via Hanxi gate. However, Li' force of several thousands were beaten back with heavy loss by the imperial general Chen Ti force and was forced to go to Cool Mountain . At night, Li Xiucheng's remaining force of a thousand went to Taiping Gate and disguised themselves as Imperial Chinese Army forces, and successfully escaped toward Piety Tomb via the section of collapsed city wall because the imperial Chinese army troops were busy looting, and did not bother to stop them. After massive looting, the city was set on fire which lasted till July 26, 1864.
Li Xiucheng did not get far after his initial breakout. Imperial general Zeng Guoquan sent out a cavalry force of 700 after his force and Li lost contact with Hong Xiuquan's son. Most of Taiping army's commanders failed to escape: Lie King Li Wangcai was captured on July 21, 1864 at Chunhua Town, while Zhang Lin Shaozhang and Junior Western King Xiao Youhe was killed at Hushu Town on the same day. On July 22, 1864, Li Xiucheng himself was captured alive near Square Mountain . On July 28, 1864, the overall commander of the battle, Zeng Guofan reached Nanking from Anqing and ordered Li to write his confession, and Li was executed after the completion on August 7, 1864. Only Zun King Lai Wenkwok succeeded in breaking out with his 3,000 cavalry to eventually join the and lead Nien Rebellion to fight for another four years.
The success of the Imperial Chinese Army was partially due to the advanced weaponry adopted, namely, the firearms. 1864 was the year when the first Chinese indigenously built bolt-action single-shot rifle appeared, and although the number was extremely few, they proved themselves over other firearms, and certainly over ancient weapons such as swords, sabres, spears and lances. The third battle of Nanking was a testing ground for the first modern Chinese firearms used in the battle.