built along the Pearl River, Chinese soldiers were deployed in Whampoa and the Bocca Tigris, and hundreds of small river craft were armed for war. A bulletin sent from the Daoguang Emperor commanded the Qing forces to "Exterminate the rebels at all points," and orders were given to drive the British from the Pearl River before reclaiming Hong Kong and driving the invaders out of China altogether. This order was leaked and became widely circulated in Canton among foreign merchants, who were already suspicious of Chinese intentions after learning of the Qing military buildup. In May many Cohong merchants and their families left the city, raising further concerns about a renewal of hostilities. Rumors spread that Chinese divers were being trained to drill holes in the hulls of British ships, and that fleets of fire rafts were being prepared for deployment against the Royal Navy. During the buildup the Qing army was weakened by infighting between units and lack of confidence in Yishan, who openly distrusted Cantonese civilians and soldiers, instead choosing to rely on forces drawn from other Chinese provinces. On 20 May Yishan issued a statement, asking the "people of Canton, and all foreign merchants who are respectfully obedient, not to tremble with alarm and be frightened out of their wits at the military hosts that are gathering around, there being no probability of hostilities." The next day Elliot requested that all British merchants evacuate the city by sundown, and several warships were recalled to their positions in front of Canton.
On the night of 21 May the Qing launched a coordinated night attack on the British army and navy. Artillery batteries hidden in Canton and on the Pearl River (many of which the British believed they had disabled earlier) opened fire, and Qing soldiers retook the British Factory. A large formation of 200 fire rafts connected by a chain was sent drifting towards the British ships at Canton, and fishing boats armed with matchlock guns began to engage the Royal Navy. The British warships were able to evade the attack, and stray rafts set Canton's waterfront on fire, illuminating the river and foiling the night attack. Downriver at Whampoa the Chinese attacked the British vessels at anchor there and attempted to prevent ships from reaching Canton. Having suspected an attack, (and as a consequence delaying his own offensive) Major General Gough consolidated the British forces at Hong Kong and ordered a rapid advance upriver to Canton. These reinforcements arrived on 25 May, and the British counter-attacked, taking the last four Qing forts above Canton and bombarding the city. The Qing army fled in panic when the city heights were taken, and the British pursued them into the countryside. On 29 May a crowd of around 20,000 Cantonese villagers and townspeople attacked and defeated a company of 60 Indian sepoys in what became known as the Sanyuanli Incident, and Gough ordered a retreat back to the river. The fighting subsided on 30 May 1841 and Canton came fully under British occupation. Following the capture of Canton the British command and the governor-general of Canton agreed to a cease-fire in the region. Under the terms of the limited peace (later widely referred to as "The Ransom of Canton"), the British were paid to withdraw beyond the Bogue forts, an action they completed by 31 May. The peace treaty was signed by Elliot without consulting the British army or Navy, an act which displeased General Gough.
The defense of Canton was declared a diplomatic success by Yishan. In a letter to the Emperor, he wrote that the barbarians had begged "the chief general that he would implore the great Emperor in their behalf, that he would have mercy upon them, and cause their debts to be repaid them, and graciously permit them to carry on their commerce, when they would immediately withdraw their ships from the Bocca Tigris, and never dare again to raise any disturbance." However, General Yang Fang was reprimanded by the Emperor for his agreeing to a truce rather than forcefully resisting the British. Th