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 holds that the Hungarian language diverged 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 being settled hunters to being nomadic pastoralists, probably as a result of early contacts with Iranian nomads (Scythians and Sarmatians). In Hungarian, Iranian loanwords 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).
Archaeological evidence from present-day southern Bashkortostan confirms the existence of Hungarian settlements between the Volga River and Ural Mountains. The Onogurs (and Bulgars) later had a great influence on the language, especially between the 5th and 9th centuries. This layer of Turkic loans is large and varied (e.g., szó ‘word’, from Turkic; daru ‘crane’, from the related Permic languages), and includes words borrowed from Oghur Turkic; e.g., borjú ‘calf’ (cf. Chuvash păru, părăv vs. Turkish buzağı); dél ‘noon; south’ (cf. Chuvash tĕl vs. Turkish dial. düš). Many words related to agriculture, state administration, and even family relationships show evidence of such backgrounds. Hungarian syntax and grammar were not influenced in a similarly dramatic way over these three centuries.
After the arrival of the Hungarians in the Carpathian Basin, the language came into contact with a variety of speech communities, among them Slavic, Turkic, and German. Turkic loans from this period come mainly from the Pechenegs and Cumanians, who settled in Hungary during the 12th and 13th centuries; e.g., koboz ‘cobza’ (cf. Turkish kopuz ‘lute’); komondor ‘mop dog’ (< *kumandur < Cuman). Hungarian borrowed many words from neighbouring Slavic languages; e.g., tégla ‘brick’; mák ‘poppy’; karácsony ‘Christmas’). These languages in turn borrowed words from Hungarian; e.g., Serbo-Croatian ašov from Hung ásó ‘spade’. Approximately 1.6 percent of the Romanian lexicon is of Hungarian origin.