Silla–Tang War

The Silla–Tang War (670–676) occurred between the Silla kingdom of Korea (joined by Goguryeo and Baekje loyalists) and the Tang dynasty of China. It began in the geopolitical context immediately following the conquest of Goguryeo and Baekje by the joint forces of Silla and Tang. The conflict ended with a truce between Tang and Silla due to the internal political situation in both states, with the dividing territorial line at the Taedong River basin.
In 668, following the Goguryeo-Tang War, despite the fall of both the Korean kingdoms of Baekje and Goguryeo, the Korean Peninsula was still not completely united under the Korean kingdom of Silla; the Silla–Tang alliance, which had defeated both Baekje and Goguryeo, resulted in the occupation of the former territories of both of these kingdoms by coalition (i.e. Silla and Tang) armies. The people of these former kingdoms underwent major upheaval: a substantial number were forcibly resettled by the Tang.
After the fall of Goguryeo in 668, the Tang Emperor created the office of Protectorate General to Pacify the East.
King Munmu of Silla then assembled the army of Silla, incorporating the remnants of the armed forces of Baekje and Goguryeo in a sort of coalition, against the Tang army. The Sillan objective was to eject the Tang forces from their positions on the Korean Peninsula (particularly the entirety of what was formerly Baekje and some of the southern portions of what was formerly Goguryeo) and prevent any Tang attempts to control Silla.
Silla's efforts were aided by revolts/uprisings in the territories of the former Korean kingdoms, notably Goguryeo; the first revolt of the people of Goguryeo took place in 669. Revolts in the former territories of Goguryeo took place for several subsequent years, the last of which endured for four years.
From 670 to 673 the rebels launched an uprising every year, the last of which lasted for four years. In 671, Silla drove Tang forces out of most of Baekje's former territory. The Goguryeo loyalists were aided by the kingdom of Silla, who were angered by Emperor Gaozong of Tang. Originally Emperor Taizong of Tang promised to exchange Baekje and the lands south of Pyongyang in return for Silla's military cooperation. However Taizong died before the conquest of Goguryeo was completed, and his successor Gaozong reneged on the promise.
In 675 the Tang attacked Silla and defeated them in Gyeonggi. In response Munmu of Silla dispatched a tributary mission to Tang with apologies. Gaozong accepted Munmu's apologies and withdrew Tang troops to deal with the Tibetan threat in the west. Seeing the Tang's strategic weakness, Silla renewed the advance on Tang territory.
In 676, Xue Rengui crossed the Yellow Sea to fight against Silla, but was unsuccessful. Tang forces were defeated by a Sillan army at the Maeso fortress, in or near present-day Yeoncheon. Silla took all the territory south of the Taedong River in a series of battles in 676. The Tang were forced to relocate the seat of the Protectorate General to Pacify the East to the more easily defensible city of Liaoyang.
Tang government's relocation of the seat/capital of the Protectorate General to Pacify the East to Liaodong was effectively the end of Tang designs on Sillan territory. Although the Tang forces were expelled from territories south of Taedong River, Silla failed to regain the former Goguryeo territories north of the Taedong River, which were now under Tang dominion. The Tang empire had taken control of the Liaodong Peninsula, while Silla controlled most of the Korean Peninsula. Relations between Tang and Silla ceased until the early 8th century, when King Seongdeok of Silla (702–737) and Emperor Xuanzong of Tang (712–755) reestablished diplomatic ties and initiated a reconciliation between the states. A formal Tang recognition of Sillan sovereignty over the Korean Peninsula south of the Taedong River occurred in 736.