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, who 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, across the Caucasus Mountains into the Kingdom of Georgia.. In the 17th century, by pressure of Kabardian princes, Ossetians started a second wave of migration from the North Caucasus to the Kingdom of Kartli. Ossetian peasants, who were migrating to the mountainous areas of the South Caucasus, often settled in the lands of Georgian feudal lords. The Georgian King of the Kingdom of Kartli permitted Ossetians to immigrate. According to Russian ambassador to Georgia Mikhail Tatishchev, at the beginning of the 17th century there was already a small group of Ossetians living near the headwaters of the Greater Liakhvi River. In the 1770s there were more Ossetians living in Kartli than ever before. This period has been documented in the travel diaries of Johann Anton Güldenstädt who visited Georgia in 1772. The Baltic German explorer called modern North Ossetia simply Ossetia, while he wrote that Kartli (the areas of modern-day South Ossetia) was populated by Georgians and the mountainous areas were populated by both Georgians and Ossetians. Güldenstädt also wrote that the northernmost border of Kartli is the Major Caucasus Ridge. By the end of 18th century, the ultimate sites of Ossetian settlement on the territory of modern South Ossetia were in Kudaro (Jejora river estuary), Greater Liakhvi gorge, the gorge of Little Liakhvi, Ksani River gorge, Guda (Tetri Aragvi estuary) and Truso (Terek estuary). The Georgian Kingdom of Kartli-Kakheti, including the territory of modern South Ossetia, was annexed by the Russian Empire in 1801. Ossetia, the area comprising modern North Ossetia, was among the first areas of the North Caucasus to come under Russian domination, starting in 1774. The capital, Vladikavkaz, was the first Russian military outpost in the region. By 1806, Ossetia was completely under Russian control. Ossetian migration to Georgian areas continued in the 19th and 20th centuries, when Georgia was part of the Russian Empire and Ossetian settlements emerged in Trialeti, Borjomi, Bakuriani and Kakheti as well. The Ossetians kept fighting against Russian Empire and never admitted Russian authorities