EtelközSee also: Magyar tribes
Following their defeat from the Pechenegs (or following the disintegration of Great Bulgaria), the seven Magyar tribes (Hungarian: Hétmagyar) that moved west settled down on the territory that Constantine Porphyrogenitus calls Etelküzü (or Etel and Küzü). The Etelköz was the first known Hungarian principality, established around 830. The territory was located around the rivers Dnieper, Southern Bug, Dniester, Prut and Siret.
Shortly afterwards, as the Emperor Constantine Porphyrogenitus recorded, the Khagan of the Khazars sent envoys to Voivode Levedi suggesting that he should be elevated to grand prince. Levedi, however, rejected the Khagan's offer and proposed instead Álmos or his son Árpád; the Khagan accepted his proposal. Although, according to the Byzantine Emperor, the heads of the seven Magyar tribes preferred Árpád, modern authors usually believe that Álmos was proclaimed the first Grand Prince of the Magyars (his title is recorded as megas Turkias arkhon in the "On Administering the Empire"). Some scholars, however, debate the credibility of the Emperor’s accounts and see the story as a legitimizing explanation invented by the Árpáds for a regime change.
According to Ahmad ibn Rustah’s work, the leadership of the Magyar tribal federation was divided between a spiritual ruler and an administrative and military leader – similar to the Khazar practise. Ahmad ibn Rustah also recorded that the nominal leader of the tribal federation Hétmagyar was styled kende, but its military leader was the gyula. In the Khazar empire, the holder of the third dignity (following its military leader) was styled kündür, which suggests that the Khazar Khagan granted this title to the newly elected head of the Magyar tribal federation.The Magyars are a race of Turks and their leader rides out with 20,000 horsemen and this king is called k.nd.h and this name denotes their king, for the name of the man who is actually king over them is ĝ.l.h and all the Magyars accept the orders of their ĝ.l.h in the matter of war and defense and the like. —Ahmad ibn Rustah
In 860–861, Magyar soldiers attacked Saint Cyril, who was traveling to the Khagan, around Chersonesos that had been captured by the Khazars.
The Hétmagyar federation may have seceded from the Khazar empire around 862, when the Magyars (Ungri) pillaged East Francia:enemies, proviously unknown for the nations, called Ungri, devastate his /Louis the German's/ country. —Annales Bertiniani
Muslim geographers recorded that the Magyars regularly attacked the neighboring East Slavic tribes and they sold their captives to the Byzantine Empire. They also mentioned thatThese Magyars are a handsome people and of good appearance and their clothes are of silk brocade and their weapons are of silver and are encrusted with pearls. —Ahmad ibn Rusta
Before 881, the Hétmagyar federation was even strengthened when the three tribes of the Kabars, who had rebelled against the Khazars, joined the Magyars.The so-called Kabaroi were of the race of the Chazars. Now, it fell out that a secession was made by them to their government, and when a civil war broke out their first government prevailed, and some of them were slain, but others escaped and came and settled with the Turks in the land of the Pechenegs, and they made friends with one another, and were called 'Kabaroi'. —Constantine Porphyrogenitus: On Administering the Empire
Thenceforward, the Kabars were regarded as military auxiliaries of the Magyars and they provided the advance and rear guards to their hosts. In 881, the Magyars and the Kabars invaded East Francia, and they fought two battles, the former (Ungari) at Wenia (probably Vienna) and the latter (Cowari) at Culmite (possibly Kulmberg or Kollmitz in Austria).
The Magyars were occasionally hired by the rulers of the neighboring territories to intervene in their struggles. According to the Annales Fuldenses, in 892, King Arnulf of East Francia invaded Great Moravia and the Magyars joined to his troops. In 894, the Magyars invaded Pannonia already in alliance with King Svatopluk I of Moravia.
At the end of the Hungarian prehistory, around 895, the Hungarians began to carry out "the Hungarian landtaking" in the Carpathian Basin where they established their new homeland.