The "H" in the name of Hungary (and Latin Hungaria) is most likely due to early founded historical associations with the Huns, who had settled Hungary prior to the Avars. The rest of the word comes from the Latinized form of Byzantine GreekOungroi (Οὔγγροι). The Greek name was borrowed from Old Bulgarianągrinŭ, in turn borrowed from Oghur-TurkicOnogur ('ten [tribes of the] Ogurs'). Onogur was the collective name for the tribes who later joined the Bulgar tribal confederacy that ruled the eastern parts of Hungary after the Avars.
The Hungarian endonym is Magyarország, composed of magyar ('Hungarian') and ország ('country'). As a matter of fact, the name "Magyar", which refers to the people of the country, more accurately reflects the name of the country in some other languages such as Turkish, Persian and other languages as Magyaristan or Land of Magyars or similar. The word magyar is taken from the name of one of the seven major semi-nomadic Hungarian tribes, magyeri. The first element magy is likely from Proto-Ugric *mäńć- 'man, person', also found in the name of the Mansi people (mäńćī, mańśi, måńś). The second element eri, 'man, men, lineage', survives in Hungarian férj 'husband', and is cognate with Marierge 'son', Finnish archaic yrkä 'young man'.