Complex sentence: When the Bagratids took control of the region in the 9th century, Bagaran was briefly its first capital but after the consecration of Ani as the new capital of Armenia, the town flourished as a stop on the transit trade route from there to the west.
Split into simpler sentences: When the Bagratids took control of the region in the 9th century, Bagaran was briefly their first capital. After the consecration of Ani as the new capital of Armenia, the town flourished as a stop on the transit trade route from there to the west.