Hunor and Magor were, according to a famous Hungarian legend, the ancestors of the Huns and the Magyars. The myth was promoted by the medieval historian Simon Kézai in his Gesta Ungarorum (1282-85). Kézai's aim in providing a common ancestry for the Huns and the Magyars was to suggest historical continuum of the Kingdom of Hungary with the Hun Empire. Magyars led by prince Árpád had conquered the area in the 890s. The territory had previously been held by Attila the Hun in the 5th century. Kézai thus tried to prove that the Magyars were simply reclaiming their ancient homeland as descendants of Attila.
In Kézai's version, the twin princes Hunor and Magor were the sons of Nimrod and were born in Scythia. (The Chronicon Pictum makes them sons of Japheth, rather than of Nimrod.) Hunters like their father, they were on a hunting trip when they saw an ethereal white stag before them (the Csodaszarvas) and chased it across the Sea of Azov. Finding the newly discovered region to their liking, they decided to stay and married the two daughters of Dula, King of the Alans. From them descended Attila the Hun and High Prince Álmos, the father of Árpád.
The myth was also employed by later writers, most notably István Werbőczy, who used it to extol the Hungarian nobility in his highly influential collection of Hungarian customary law (the Tripartitum, completed 1514, first published 1517). According to Werbőczy, the Hungarians, as descendants of Hunor and Magor, were of 'Scythian' origin and subject to 'Scythian' law. "The Hungarians inherited their moral values and customs from the 'Scythians', who had once defeated even Darius and Alexander the Great. Their true vocation was war, which was the only activity that was noble enough to suit them." The nobles were free and equal; the peasants were the descendants of those who had been condemned for cowardice in battle and whose punishment had been commuted from execution to losing their social rank. Werbőczy thus used the Hunor and Magor myth to justify Hungarian serfdom. Werbőczy's ideas were eagerly adopted by the Hungarian nobility and became the charter of common law for three centuries. 
The nobles particularly cherished their 'Scythian' identity. According to Engel:
It made the nobility inclined to think in terms of historical fictions and to cherish illusions. They thought that they had the right to rule their subjects without having to meet any obligations. It also involved an extreme respect for traditions, and gave birth to what was an early form of 'nationalism'. The nobility's ideology overvalued everything that was, or was thought to be, ancient, and regarded everything that seemed strange or unusual with aversion or even hostility [...] The nobility also took delight in hearing about 'Scythian' values, for they imagined they recognised their own virtues in them. Among the petty nobility the ideal of martial simplicity must have become especially popular, for it made a virtue out of their misery and illiteracy."
János Arany retold the myth in his poem Rege a csodaszarvasról (Legend of the Miraculous Hind).
- Pál Engel The Realm of Saint Stephen: A History of Medieval Hungary 895-1526 (I.B. Tauris, 2001)
- Miklós Molnár A Concise History of Hungary (Cambridge University Press, 2001)
- Gog and Magog
- Lech, Czech and Rus
- Romulus and Remus
- Hengest and Horsa
- Sarmatism (the belief that the Polish nobility were of Sarmatian descent)
- Gothicismus (the belief that the Swedes were descended from the Goths)