Siege of Ansi

The Siege of Ansi occurred from 20 June to 18 September 645 when the Tang Chinese army under Emperor Tang of Taizong laid siege to the Goguryeo fortress of Ansi in Liaoning. The massive 200,000-strong Chinese army faced a mere 4,000 troops in the city, but the Koreans bravely held out against the invaders until winter set in, decimating the Tang army and forcing Taizong to retreat.

Background
In 645 AD, Emperor Taizong of Tang and an army of 200,000 Tang Chinese troops invaded Goguryeo, overwhelming the border fortresses and destroying a Korean army of 150,000 troops in the Battle of Mt. Jupil; only 10,000 Koreans survived the battle. Their commander, Yeon Gaesomun, decided to withdraw to defend the capital, planning to evacuate Ansi Fortress. However, the general Yang Manchun and the 4,000-strong garrison decided to take a stand against the invading Chinese army, defying the odds and refusing to surrender; Yang Manchun led his men in crying "To battle!" in front of the Chinese, stating that the Korenas cherished their families and would fight to protect them. Emperor Taizong then told his soldiers that they could loot the Koreans' property, enslave their children, and rape every woman in sight, and then ordered them to besiege the fortress.

Initial assault
The assault began when the Chinese fired their trebuchets at the city walls, and, while the huge rocks panicked the Goguryeo defenders, the walls held, as their outside was made with stone, but their inside was filled with dirt. When Li Shiji informed him of this, Emperor Taizong ordered his men to charge the walls and scale them. The Goguryeo wall defenses were almost overrun, but the Koreans deployed rock and spike traps to destroy the ladders and kill several of the assailants. When the Chinese brought up their battering ram, Yang Manchun had the crossbow commander Beck-ha and the cavalry commander Pa-so massacre the Chinese troops attacking the flanks of the city.

Breaching the gates
The Chinese eventually breached the gate, but Yang Manchun had stake traps deployed, using a wooden stake gate to prevent reinforcements from arriving and placing stakes around the Chinese attackers to trap them between the gate and the sharp stakes. The Korean spearmen then proceeded to spear or shoot several of the trapped Chinese troops, and Korean spearwalls also pushed several Chinese troops over the walls to their deaths. Yang ordered ballistae to shoot the Chinese siege ramps before using the ropes attached to the missile to pull the ramps down, defeating the Chinese assault. The Emperor was forced to order a retreat, and the Koreans cheered for their victory.

Second assault
The Chinese hid themselves behind smoke for days as they prepared for a new assault against the city's defenses. They built several new siege towers before assaulting the city at night, and the archers on the siege towers loosed fire arrows into the city, burning several civilians' homes and causing panic. The Goguryeo defenders were on the verge of defeat when Yang ordered his men to bring out oil pouches, throwing them above the siege towers before shooting them with fire arrows. Liquid fire rained down upon the siege towers, setting them on fire and massacring the besiegers. Yang was wounded by a javelin to the arm, but he was saved by his standard bearer Eulbul Sa-mul, and the Chinese retreated as their towers burned and their assault failed.

Emperor Taizong was furious, so he decided to send out a captive Korean medium to request that Yang surrender; she was coincidentally Yang's former fiancee. However, Yang sent the cavalry commander Pa-so to attack Taizong's golden tent in a surprise attack, hoping to kill the emperor and end the battle. The medium fired an arrow at the Chinese camp with a warning attached to it, hoping that helping the Chinese would lead to the Chinese allowing the Koreans to surrender. Pa-so and all of his men were killed in the ambush, and the medium confessed her guilt to Yang, leading to Eulbul executing her by cutting her throat. The next morning, Pa-so's lover Baek-ha rode out by herself to challenge Taizong, killing several Chinese troops and even scarring Tang across the cheek with a crossbow bolt before being killed.

Siege mound
To make matters worse, the Chinese army completed the construction of a dirt mound as tall as the fortress walls, allowing for the besiegers to scale the walls without the need for ladders. Yang decided to tunnel under the mound to make it collapse, which would ruin the Chinese army's assault plans. Woo-dae and his team volunteered to sacrifice themselves by tunneling under the mound and then chopping down its supports, which would lead to the mound's collapse and their own deaths. Yang reluctantly allowed for Woo-dae to carry out his mission, and the mound collapsed on top of the Korean engineers while also killing the thousands of Chinese troops who had been preparing to storm the walls from a bridge atop the mound. Yang ordered a counterattack to take the mound, and the mound's commander Fu Fuai abandoned his men and fled back to the main camp, where an angry Emperor Taizong put him to death.

Final assault
Taizong rejected Li Shiji's advice to withdraw and insisted on another assault, carrying out one massive, final assault. The Goguryeo troops cast down flaming wheels at the Chinese troops as they attempted to charge up the mound, and archers also inflicted heavy casualties on the Chinese forces. The Chinese again nearly overwhelmed the defenders, but Yang used a sacred Goguryeo bow to fire an arrow which struck Taizong in the eye, leading to his army panicking and being forced to retreat. Shortly after, Yeon Gaesomun arrived with Korean reinforcements, and the Chinese army was routed.

Aftermath
The Chinese army was forced to flee as Korean reinforcements arrived and the Chinese food supplies were depleted by the cold weather. Taizong's retreat was marred by winter attrition, which killed thousands of his soldiers and decimated his army. Taizong fell ill during his retreat from Ansi, and, while planning another invasion of Goguryeo in 648, he died. However, after Yeon Gaesomun's death in 666 AD, a war of succession broke out in Goguryeo, weakening the country and allowing the Tang to conquer Goguryeo in 668 AD.