Modern nationalism valorises a people’s deep, primordial relationship with land. It also depends on enemies, outsiders and foreigners to help unite the members of the nation. These claims do not have to be historically accurate to be politically powerful. Far-right Hindu nationalists in India today, for example, claim that the Taj Mahal, a symbol of the Muslim sultans of the Mughal dynasty, was originally a Hindu temple. Defying historical fact, such claims portray Indian nationalist movements as guardians of native heritage while denying Indian Muslims any ties to the nation’s past glories.

For much of Western history, however, claiming foreign ancestry was the key to political legitimacy. From the Roman Empire to the Renaissance, noble families across Europe insisted that they were not related to the populations they ruled. They traced their ancestry back to illustrious foreign powers, including figures of myth and legend. Among the most popular were the protagonists of the Trojan War. Europeans were familiar with the exploits of Greek heroes such as Ajax and Achilles as recorded in the Iliad. Roman emperors, Germanic warlords and crusading nobles, however, identified themselves not with the Greek victors of the war, but with the defeated Trojans. While European nationalists today see migrants of Middle Eastern wars as an existential threat to their homelands, Europe’s Roman and medieval elites boasted of their Trojan ancestors, refugees fleeing the ruins of their Asian home.

The most famous of these refugees was Aeneas, a legendary prince of Troy. Barely mentioned in the Iliad, he became a key figure of Roman myth in the first century BCE. Romans imagined that the Trojan prince had escaped his city as it was sacked by the Greeks. Aeneas resettled in Italy, conquered the local people and became the forefather of Romulus, founder of Rome. The Roman Republic was by then master of the Mediterranean world, and the story of Aeneas offered justification for its conquests. By conquering the Italian peninsula, it could be argued, Rome had finished Aeneas’ mission. By humbling the Greek city-states and Hellenistic kingdoms of the eastern Mediterranean, Rome had avenged Troy’s fall. The Romans were an intensely patriotic people, but rather than imagine themselves as sons of the Italian soil, they preferred to think that they were born to move, fight and reign across the world.

The legend of Aeneas was such a powerful ideological tool that the ambitious general and politician Julius Caesar (100-44 BCE) and his adopted son Augustus (63-14 BCE) made it their own, creating a genealogy to prove their direct descent from Aeneas. The poet Virgil immortalised their claims in the Aeneid, an epic poem about Aeneas’ journey from Troy to Rome (written in 29-19 BCE). Caesar and Augustus transformed the Roman Republic into an empire ruled by a single dynasty. They smoothed the transition by conflating Rome’s Trojan heritage with their own family tree. Foreign origins served to differentiate the imperial household from the Roman masses, and to legitimise a cosmopolitan empire.

The imperial myth of Aeneas would outlive the empire. In the turbulent third, fourth and fifth centuries CE, groups of Germanic warriors wrested much of western Europe from Roman control. Besides seizing territory, Germanic elites also appropriated the symbols of Roman authority, including the myth of Trojan origins. The Merovingians, rulers of the Frankish tribes who had seized what is now France, stole a page from Virgil’s book in the seventh-century Chronicle of Fredegar. This text traced the history of the Franks back to Francio, a clone of Aeneas who supposedly settled on the Rhine. When the Carolingians, a rival Frankish dynasty, deposed the Merovingians, these newcomers sought to prove that they were even more Trojan than the kings they had overthrown. In chronicles and poems, the propagandists of the Carolingian court celebrated its rulers as descendants of Aeneas, asserting their connections to the most celebrated Trojan exile.

The other dynasties of western Europe forged their own stories of Trojan ancestry, eager not to let the Franks keep the symbolic heritage of Troy and Rome to themselves. After their conquest of England in 1066, the Normans, originally of Viking origin, invented the Trojan hero Brutus, who was said to have fled Troy at the same time that Francio and Aeneas were setting out for the Rhine and the Tiber. In Germany, rival dynasties seeking control of the Holy Roman Empire claimed that they, too, were the offspring of a Trojan refugee. Mythical genealogies offered a basis for elites across Europe to emphasise their superiority over common people. Heirs to Troy, and by extension to the Roman Empire, they had a right to rule inherited from the heroes of classical antiquity.

Like the Romans, medieval Europeans used their purported connections to Troy as a rationale for conquest. In 1204, relatives of the French royal family diverted what was supposed to be a crusade in Syria and Palestine towards a new target: Constantinople. The capital of the Greek-speaking Byzantine Empire, it was the largest and wealthiest city in Europe. The crusaders sacked it, slaughtering thousands of fellow Christians. To justify their actions, French leaders of the crusade claimed that they were taking their revenge against the Greeks for the fall of their ancient Trojan homeland. Instead of fighting Muslims in the Holy Land, they refought the Trojan War.

For nearly 1,500 years, ties to ancient Troy offered Europe’s leaders justification for autocratic rule at home and military adventures abroad. But, by the early modern era, Europe was beginning to forget its Trojan roots. The rise of the Ottoman Turks, who conquered Constantinople in 1453 and menaced Europe for the next 300 years, seems to have dampened European rulers’ enthusiasm for being identified with Asia Minor. Meanwhile, historians of Europe’s emerging nation-states debunked legends about Trojan immigrants settling Britain, Germany and France. They sought to learn more about the long-forgotten ancient peoples of the continent, like the pre-Roman Celts.

By the end of the 18th century, as the age of democratic revolutions began, European aristocrats would have reason to regret their conspicuous identification with foreigners. Leading figures of the French Revolution denounced the nobility as descendants of barbarian invaders, and identified the common people as the true heirs of the Celts. Today, the Celts or ‘Gaulois’ are still key figures in French national consciousness, inspiring the comic-book hero Asterix. Trojans – and aristocrats who claimed descent from them – are nowhere to be seen.

In recent years, many scholars have highlighted the longstanding historical connections between Europe and Asia, or Europe and Islam, as a response to nationalist movements across Europe that see immigrants as a threat to local cultures. By challenging accounts of history that pit virtuous natives against dangerous outsiders, such historians promote more inclusive understandings of identity and more open immigration policies. But, from the long view of European history, nationalist myths about indigenous peoples are a recent invention, a response to elites’ emphasis on their foreign origins. Roman and medieval rulers’ cosmopolitan identities were no guarantee of tolerant or peaceful policies.

Scholars who try to resist the rising tide of nationalism in Europe and throughout the world by pointing to the rich connections between cultures of the past should be on guard against undue optimism; for centuries, identification with immigrants from Asia Minor was an ironic but effective tool of imperial power.