Zhang Hongfan of the Yuan, reinforced by Li Heng, who previously had captured Guangzhou, attacks the Song navy in Yamen in 1279.
Some within the Song forces suggest that the navy should first claim the mouth of the bay, to secure their line of retreat to the west.
Zhang Shijie turns down this suggestion in order to prevent his soldiers from fleeing the battle.
He then orders the burning of all palaces, houses and forts on land for the same reason.
Zhang Shijie orders about one thousand warships to be chained together, forming a long string within the bay, and places Emperor Huaizong's boat in the center of his fleet.
This is done to prevent individual Song ships from fleeing the battle.
The Yuan forces steer fire ships into the Song formation, but the Song ships are prepared for such an attack: all Song ships have been painted with fire-resistant mud.
The Yuan navy then blockades the bay, while the Yuan army cuts off Song's fresh water and wood sources on land.
The Song side, with many noncombatants, soon runs out of supplies.
The Song soldiers are forced to eat dry foods and drink sea water, causing nausea and vomiting.
Zhang Hongfan even kidnaps Zhang Shijie's nephew, asking Zhang Shijie to surrender on three occasions, to no avail.
Zhang Hongfan prepares for a massive assault in the afternoon of March 18.
The employment of cannons is rejected because Hongfan feels that cannons could break the chains of the formation too effectively, making it easy for the Song ships to retreat.
The next day Zhang Hongfan splits his naval forces into four parts: one each of the Song's east, north, and south sides, while Hongfan leads the remaining faction to about a li away from the Song forces.
First, the north flank engages the Song forces but are repulsed.
The Yuan then begin playing festive music, leading the Song to think that the Yuan forces are having a banquet and lowering their guard.
At noon, Zhang Hongfan attacks from the front, hiding additional soldiers under large pieces of cloth.
Once Zhang Hongfan's boats near the Song fleet, the Yuan sounds the horn of battle, revealing the soldiers under the fabric.
The Song troops are prepared for a small skirmish, not a large assault.
Waves of arrows hit the Song ships.
Caught off guard, the Song fleet immediately loses seven ships, along with a great number of troops in the process.
The ill and weakened Song soldiers are no match for the Yuan troops in close combat, and the chaotic environment makes battle command impossible.
The chained Song ships can neither support the middle or retreat.
After the Song troops are killed, the bloody slaughter of the Song court begins.
Seeing that the battle is lost, Zhang Shijie picks out his finest soldiers and cuts about a dozen ships from the formation in an attempted breakout to save the emperor.
The Yuan forces quickly advanced to the center and to Emperor Huaizong, killing everyone in their way.
Here, Left Prime Minister Lu Xiufu sees no hope of breaking free and, taking the boy emperor with him, jumps into the sea, where both drown.
Many officials and concubines follow suit.
The History of Song records that, seven days after the battle, hundreds of thousands of corpses floated to the surface of the sea.
Reportedly, the body of the boy emperor was found near today's Shekou in Shenzhen, though his actual grave has yet to be found.
Zhang Shijie, having escaped the battle, hoped to have Dowager Yang appoint the next Song emperor, and from there continue to resist the Yuan dynasty.
However, after hearing of Emperor Huaizong's death, Dowager Yang also commits suicide at sea.
Zhang Shijie buries her at the shore.
He and his remaining soldiers are assumed to have drowned at sea, as a tropical storm whipped up soon afterwards.
The death of Emperor Huaizong of Song effectively ends the Song dynasty, thus leading the House of Zhao, for the first time, to lose control over China after three hundred and nineteen years.
The Yuan dynasty, under Kublai Khan, now has all of China under its control.
He and and his descendants and followers will rule China for ninety-seven years until the rise of the native Ming dynasty under the Hongwu Emperor of the House of Zhu.