The Silla-Tang war and unification was the endgame of the seventh century's three-way contest on the peninsula. In 660 the Tang-Silla fleets crossed the sea and destroyed Baekje; in 663 the battle of Baekgang (Battle of Baekgang) annihilated the Baekje restorationists and their Japanese allies; in 668 Goguryeo fell in its turn. Tang set the Andong Protectorate at Pyongyang and five subordinate commands to hold the conquered lands outright; Munmu of Silla refused to be a screen for another's empire, took in the Goguryeo remnant, backed the Baekje loyalists in secret, and from 670 turned against Silla's yesterday ally (the Silla-Tang war). In 675 at Maesoseong Silla smashed the Tang army; with several columns beaten and the Tibetans burning on the western front (the great defeat at Dafeichuan in 670), the Tang court weighed and withdrew: in 676 the Andong Protectorate pulled back to Liaodong and the Ungjin command dissolved. Silla thus controlled everything south of the Taedong — most of the peninsula unified — and Tang and Silla turned at once back to suzerain and trader, Silla students and monks crossing to Tang in endless procession. This unification by borrowed arms then turned on the lender fixed the basic pattern between the peninsula's states and the central kingdoms for all that followed.