The Karapapakhs or Terekeme (Qarapapaqlar, Tərəkəmələr; Karapapaklar, Terekemeler) are a Turkic people, who originally spoke the Karapapakh language, a western Oghuz language closely related to Azerbaijani and Turkish. Nowadays, the Karapapakh language has been largely supplanted by Azerbaijani and Turkish. After moving into Western Asia in the Middle Ages together with other Turkic speakers and Mongol nomads, the Karapapakhs settled along the Debed river in eastern Georgia (along the present-day Georgian-Armenian border). They moved to Qajar Iran, and the Ottoman Empire after the Treaty of Turkmenchay was concluded between Iran and Russia in 1828. The Karapapakhs who remained within the Russian Empire were counted as a separate group in Tsarist population figures. During the Soviet Union's existence, the Karapapakhs were culturally and linguistically assimilated by the Azerbaijanis, and they were counted as "Azerbaijanis" in the 1959 and 1970 Soviet censuses. In 1944 the Karapapakh in the Soviet Union were deported en masse to Soviet Central Asia. The Karapapakhs have traditionally been Sunnis, Shias, and adherents of Ali-Illahism. According to the latest western ethnographic works that primarily dealt with the ethnography of the Soviet Union, most Karapapakhs in the 1980s lived in Turkey, Iran, Soviet Central Asia (primarily the Uzbekistan SSR) and the Soviet republics of the Caucasus (primarily the Georgian SSR and the Armenian SSR). Karapapakh translates as "black hat" in Oghuz Turkic. The Karapapakhs are sometimes referred to as Terekeme or Tarakama (from Tarākameh, the broken plural for Turkmen—a term traditionally used for any Turkic nomadic people). The Karapapakhs were originally a Turkoman group. George Bournoutian referred to them as "Turkicized Kazakhs (Qazzaqs)." They had moved into Western Asia in the Middle Ages together with other Turkic-speaking and Mongol nomads, where some had become peasants. The Karapapakh fought on the Iranian side against the Russians in the Russo-Persian War of 1804–1813.