 By the early 9th century, the former territories of the Kamsarakans in Arsharunik and Shirak (including Ani) had been incorporated into the territories of the Armenian Bagratuni dynasty.Their leader, Ashot "Msaker" (Ashot the Meateater) (806–827) was given the title of "ishkhan" (prince) of Armenia by the Caliphate in 804.The Bagratunis had their first capital at Bagaran, some 40 km south of Ani, before moving it to Shirakavan, some 25 km northeast of Ani, and then transferring it to Kars in the year 929.