The T’ang Dynasty engaged in a highly successful campaign of territorial expansion during its early years. Its influence stretched far to the west, well into Central Asia. Its main rival in this area was the Tibetan Empire, with which it often held an uneasy alliance. Right at the furthest reaches of the Chinese sphere of influence, the T’ang dynasty came into contact with the Abbasid Caliphate. The Abbasid Caliphate and the Tibetan Empire allied against the T’ang dynasty during its westward expansion in 751. The resulting Battle of Talas River ended in defeat for the T’ang dynasty and would mark the end of its push into Central Asia. In the east, the T’ang Dynasty moved into the Korean Peninsula, fighting the Koguryo–T’ang War against the Koguryo Kingdom between 645–68. The T’ang Dynasty then turned against its ally in the south of the peninsula, the Silla Kingdom, conquering it in 676.