In 821, it formed the Armenian principality of Khachen and around the year 1000 was proclaimed the Kingdom of Artsakh, one of the last medieval eastern Armenian kingdoms and principalities to maintain its autonomy following the Turkic invasions of the 11th to 14th centuries.