The Lebor Gabála (Book of Invasions — probably first written in the second half of the 11th century AD) describes the origin of the Gaelic people. They descended from Goídel Glas, a Scythian who was present at the fall of the Tower of Babel, and Scota, a daughter of a pharaoh of Egypt. Two branches of their descendants left Egypt and Scythia at the time of the Exodus of Moses, and after a period of wandering the shores of the Mediterranean (including sustained settlements at Miletus and Zancle) arrived in the Iberian Peninsula, where they settled after several battles. One of them, Breogán, built a tower at a place called Brigantia (probably in the coast of Galicia, near A Coruña (Corunna), which was then "Brigantia" (today Betanzos) and where a Celtic tribe called "Brigantes" is attested in ancient times — see Tower of Hercules) from the top of which he, or his son Íth, first saw Ireland.
Íth made the first expedition to Ireland, but was killed by the three kings of Ireland, Mac Cuill, Mac Cecht, and Mac Gréine of the Tuatha Dé Danann. In revenge the eight sons of Íth's brother Míl Espáine (the "Soldier of Hispania", whose given name was Golam), led an invasion force to defeat the Tuatha Dé and conquer Ireland. The sons of Míl landed in County Kerry and fought their way to Tara. On the way, the wives of the three kings, Ériu, Banba, and Fodla requested that the island be named after them: Ériu is the earlier form of the modern name Éire, and Banba and Fodla were often used as poetic names for Ireland, much as Albion is for Great Britain.
At Tara the sons of Míl met the three kings, and it was agreed that the invaders would return to their ships and sail a distance of nine waves from Ireland, and if they were able to land again, Ireland would be theirs. They set sail, but the Tuatha Dé used magic to call up a storm in which five of the sons were drowned, leaving only Eber Finn, Eremon, and Amergin Glúingel the poet to land and take the island. Amergin divided the kingship between Éremon, who ruled the northern half, and Éber Finn, who ruled the southern half of the realm.
In the historical scheme proposed by T. F. O'Rahilly the descent of the kings of Ireland from the sons of Míl is a fiction intended to provide legitimacy for the Goidels, who invaded Ireland in the 1st or 2nd century BC, giving them the same ancient origin as the indigenous peoples they dominated. However, it has been argued that the story is a much later invention of mediæval Irish historians, inspired by their knowledge of the Seven Books of History Against the Pagans, written by the early 5th century Gallaecian cleric, Paulus Orosius. See also Early history of Ireland.
The Dal Riadan clans who moved from Ulster to western Scotland about 500AD succeeded in acquiring the kingship, and Malcolm Canmore, a descendant, used the Milesian insignia of a rampant lion. It is still on the Royal Standard of Scotland today.
For centuries, the myth of the Míl Éspaine and the Milesians was used in Ireland to win and secure dynastic and political legitimacy. For example, in his Two bokes of the histories of Ireland (1571), Edmund Campion tried to use the myth to establish an ancient right of the British monarch to rule Ireland. In A View of the Present State of Ireland, Edmund Spenser accepted and rejected various parts of the myth both to denigrate the Irish of his day and to justify English colonisation of Ireland in the 1590s (at the height of the Anglo-Spanish war).
Probably the last major outing for the myth was during the Contention of the bards, which appears to have rumbled on from 1616 to 1624. During this period poets from the north and south of the island extolled the merits of their respective peoples (Eremonians and Eberians), at the expense of the other side, and often descended to a pettiness that some contemporaries thought foolish.
Finally, Geoffrey Keating's Foras Feasa ar Eirinn (written c.1634) used the myth to promote the legitimacy of the Stuart claim to royal authority in Ireland (related to the origin of the Lia Fáil), demonstrating that Charles I was descended, through Brian Bóroimhe, Éber and Galamh, from Noah and, ultimately, from Adam. The lion-rampant motif seen in the Royal Standard of Scotland was used by other clans claiming a Milesian ancestry.
There is a legend that Queen Scota's grave is in the Slieve Mish mountains just outside Tralee in County Kerry. The legend tells that Scota was the daughter of a pharaoh and was to marry the Irish king, but she fell from her horse and died. A large rock marks the spot where she fell.