With the surrender of Ani to the Byzantine Empire in 1045 and the Byzantine annexation of Kars in 1064, the final independent Armenian state in historic Armenia, Bagratuni kingdom, came to an end. However, despite foreign domination of the region, which became more pronounced after the Seljuk Turks defeated the Byzantines at the Battle of Manzikert in 1071, Armenians in eastern Armenia were able to maintain autonomy in the two mountainous kingdoms of Syunik and Lori and in the Principality of Khachen. From the early to mid-12th century, the combined Georgian and Armenian armies were successful in pushing the Turks out of Eastern Armenia, thereby establishing a period of relative peace and prosperity until the appearance of the Mongols in 1236.