Well served by its natural defences, Ani was selected by the Armenian Bagratid king Ashot III (r 952–77) as the site of his new capital in 961, when he moved here from Kars. Ashot's successors Smbat II (r 977–89) and Gagik I (r 990–1020) presided over Ani's continued prosperity. But internecine feuds and Byzantine encroachment weakened the Armenian state and the Byzantines took over Ani in 1045.
Then in 1064 came the Great Seljuks from Persia, followed by the Kingdom of Georgia and, for a time, local Kurdish emirs. The struggle for the city went on until the Mongols arrived in 1236 and decisively cleared everybody else out. The nomadic Mongols had no use for city life, so cared little when the great earthquake of 1319 toppled much of Ani. The depredations of Central Asian conquerer Tamerlane later that century hastened the decline; trade routes shifted, Ani lost what revenues it had managed to retain, and the city died. The earthquake-damaged hulks of its great buildings have been slowly crumbling away ever since.