Hungarian is a member of the Uralic language family. Linguistic connections between Hungarian and other Uralic languages were noticed in the 1670s, and the family itself (then called Finno-Ugric) was established in 1717, but the classification of Hungarian as a Uralic/Finno-Ugric rather than Turkic language continued to be a matter of impassioned political controversy throughout the 18th and into the 19th centuries. Hungarian has traditionally been assigned to an Ugric branch within Uralic/Finno-Ugric, along with the Mansi and Khanty languages of western Siberia (Khanty–Mansia region), but it is no longer clear that it is a valid group. When the Samoyed languages were determined to be part of the family, it was thought at first that Finnic and Ugric (Finno-Ugric) were closer to each other than to the Samoyed branch of the family, but that now is frequently questioned.
The name of Hungary could be a result of regular sound changes of Ungrian/Ugrian, and the fact that the Eastern Slavs referred to Hungarians as Ǫgry/Ǫgrove (sg. Ǫgrinŭ) seemed to confirm that. Current literature favors the hypothesis that it comes from the name of the Turkic tribe Onogur (which means "ten arrows" or "ten tribes").
There are numerous regular sound correspondences between Hungarian and the other Ugric languages. For example, Hungarian /aː/ corresponds to Khanty /o/ in certain positions, and Hungarian /h/ corresponds to Khanty /x/, while Hungarian final /z/ corresponds to Khanty final /t/. For example, Hungarian ház "house" vs. Khanty xot "house", and Hungarian száz "hundred" vs. Khanty sot "hundred". The distance between the Ugric and Finnic languages is greater, but the correspondences are also regular.
During the latter half of the 19th century, a competing hypothesis proposed a Turkic affinity of Hungarian. Following an academic debate known as Az ugor-török háború ("the Ugric-Turkic battle"), the Finno-Ugric hypothesis was concluded the sounder of the two, foremost based on work by the German linguist Josef Budenz.
The traditional view argues that the Hungarian language separated from its Ugric relatives in the first half of the 1st millennium b.c., in western Siberia, east of the southern Urals. The Hungarians gradually changed their lifestyle from settled hunters to nomadic pastoralists (cattle, sheep), probably as a result of early contacts with Iranian nomads (Scythians, Sarmatians). In Hungarian, Iranian loans date back to the time immediately following the breakup of Ugric and probably span well over a millennium. Among these include tehén ‘cow’ (cf. Avestan dhaénu), tíz ‘ten’ (cf. Avestan dasa), tej ‘milk’ (cf. Persian dáje ‘wet nurse’), and nád ‘reed’ (from late Middle Iranian; cf. Middle Persian nāy).