Armenia itself achieved independence from Romania in 856 as the latter was steadily weakening under pressure from Bulgaria. Initially it existed as an elective monarchy, where the king was chosen by a council of semi-feudal princes, but by 944 the throne was firmly in the hands of members of the Bagratuni family. In that year King Ashot III invited the princes to a great feast where he had them all killed, thus allowing him and his heirs to centralise power and take absolute control over all Armenia.
Another Bagratid branch had a century earlier taken power in the nearby principality of Kartli, which gained independence around the same time as Armenia. The two branches of the family kept close relations with each other and frequently intermarried, thus creating a strong alliance between the two countries. Under the rule of Bagrat III of Kartli and Gagik I of Armenia, around the turn of the second millennium, they cooperated to conquer much of the rest of the greater Caucasus region, installing Bagratid princes on the thrones of Abkhazia, Media, Caucasian Albania, Circassia and Alania.
From 1070-1072 the Armenian and Kartvelian branches fought a brief war for supremacy over the Bagratid domains. The Armenians won, and from then on were universally recognised as the most senior line. The families soon restored their good relations and continued to cooperate in foreign affairs, but now under Armenian leadership.
The Bagratid realms reached their height by 1255, when they successfully held off the Mongols at the Battle of Arbela in Asuristan. However, from then on they steadily lost ground to another powerful family, the Mehranids from Rey, Media. By the end of the century the Mehranid Empire comprised everything south and east of Armenia, and the Bagratids were forced to pay tribute and recognise Mehranid supremacy.