The Ossetians are believed to originate from the Alans, a nomadic Iranian tribe. In the 8th century a consolidated Alan kingdom, referred to in sources of the period as Alania, emerged in the northern Caucasus Mountains. Around 1239–1277 Alania fell to the Mongol and later to the Timur's armies, that massacred much of the Alanian population. The survivors among the Alans retreated into the mountains of the central Caucasus and gradually started migration to the south.