Western Armenia had been under Byzantine control since the partition of the Kingdom of Armenia in AD 387, while Eastern Armenia had been under the occupation of the Sassanid Empire starting 428. Regardless of religious disputes, many Armenians became successful in the Byzantine Empire and occupied key positions. In Sassanid-occupied Armenia, the people struggled to preserve their Christian religion. This struggle reached its culmination in the Battle of Avarayr. Although the battle was a military defeat, Vartan Mamikonian's successor, Vahan, succeeded to force the Persians to grant religious freedom to the Christian Armenians in the Nvarsak Treaty of 484.
After the death of the Islamic prophet Muhammad in 632, the Arabs expanded their religion throughout the Middle East. In 639, with a force of 18,000 warriors, Abd‑er‑Rahman took Taron and sacked the country. In 642, the Muslims took Dvin, slaughtered 12,000 of its inhabitants and carried 35,000 into slavery. Prince Theodoros Rshtuni organized resistance and liberated the enslaved Armenians. However, Theodoros eventually accepted Arab rule of Armenia. Thus, in 645, the entirety of Armenia fell under Islamic rule. This period of 200 years was interrupted by a few restricted revolts, which never had a pan-Armenian character. Most petty Armenian families were weakened in favor of the Bagratunis and Artsrunis.
As Islamic power was waning, Ashot I of the Bagratuni family got more influence in Armenia. He became prince of princes in 861, and after a war against nearby Arab emirs, in 885, he was recognized as King of Armenia by both the Caliph of Baghdad and the Emperor of Constantinople. After more than 450 years of foreign occupation, Armenians finally reasserted their sovereignty in their ancestral lands. Despite Bagratid efforts to control all Armenian noble families, the Artsrunis and Siunis eventually broke off from central rule. Ashot III transferred the capital from Kars to Ani, which came to be known as the "city of 1001 churches". Ani became an important cultural and economic center in the whole region. Bagratid Armenia fell in 1045 to the Byzantines and then in 1064 to Seljuk Turks.
The Kingdom of Cilicia was founded by the Rubenian dynasty, an offshoot of the larger Bagratid family that at various times held the thrones of Armenia and Georgia. Their capital was Sis.
Cilicia was a strong ally of the European Crusaders, and saw itself as a bastion of Christendom in the East. It also served as a focus for Armenian nationalism and culture, since Armenia was under foreign occupation at the time. In the mid-13th century, King Hethoum I of Armenia voluntarily submitted the country to Mongol overlordship, and tried to encourage other countries to do the same, but was only able to persuade his son-in-law, Bohemond VI of Antioch, who submitted in 1259; however, Antioch was then wiped out in retaliation by the Muslims in 1268. Cilicia remained as a Mongol vassal until it too was destroyed in the mid-14th century by the Egyptian Mamluks.