II. THE GROWTH OF THE THREE KINGDOMS AND UNIFICATION
2. Unification of the Three Kingdoms by Shilla

(1) Koguryo's Great Victory at Salsu and Ansi-song

When Shilla occupied the Han River basin in the latter 6th century, Koguryo and Paekche made a pact to attack Shilla. To ward them off, isolated Shilla approached China for help.
At this time, long-split China was unified by Sui. Koguryo was frequently attacked by Sui but managed to expel them with the resistance of its united army and the entire population. In particular, when a large army of more than a million under the personal command of Emperor Yangdi of Sui invaded Koguryo, General Uljimundok feigned defeat in order to lure the 300,000 special soldiers of Sui and all but annihilated them at the Battle of Salsu (Ch'ongch'on River). This was the great victory of Salsu in 612, and it has come to be known as the most glorious military triumph in Korea's national history. Following Sui, the Tang Dynasty, which then ruled over China and had maintained at one time friendly relations with Koguryo, prepared to invade Koguryo when Emperor Taizong of Tang came to the throne.
In Koguryo, Yongaesomun was in power and fiercely confronted Tang's attack. Taizong led a large army to lay siege on Ansi-song while the defending soldiers and citizens resisted the concentrated attack for 60 days. They fought valiantly and drove back Taizong's soldiers in 645. It was a glorious triumph over a national crisis by the unified effort of the Koguryo people.
 
(2) Destruction of Paekche and Koguryo
Shilla, isolated on the Korean peninsula, formed an alliance with the Tang Dynasty against Koguryo and Paekche. Shilla drew help from the Tang army and attacked Paekche first. The death bands of Kyebaek fought against the Shilla army under the command of Kim Yu-sin with much courage, but they were defeated by the overwhelming numbers of Shilla troops. Finally Sabi-song fell to the allied troops of Shilla and Tang, and Paekche fell in 660.
In Koguryo, after the death of Yongaesomun, internal dissension rose among the leading generals. Taking advantage of this opportunity, Shilla and Tang attacked Koguryo. After resisting the attack for a year, P'yong'yang fell and the Kingdom was destroyed in 668.
 
(3) War between Shilla and Tang and Unification of the Three Kingdoms by Shilla
After the downfall of Paekche and Koguryo, Tang ruled over their former domains and even tried to incorporate Shilla into the sphere of its rule. Confronted with Tang's threat, Shilla combined the strength of the defeated people of Paekche and Koguryo and waged a fight against Tang for 10 years.
Shilla smashed the Tang army in the battle of Maech'o-song and destroyed the Tang navy at the mouth of the Kum River. Shilla finally drove out the Tang armed forces and succeeded in unifying the Three Kingdoms in 676.
Shilla's unification of the Three Kingdoms was not a complete one, limited only to the south of the Taedong River and the Bay of Wonsan. But it did form the basis for an independent national government and a national culture throughout the Korean peninsula.