Matthew Gabriele is a professor of medieval studies in the department of religion and culture at Virginia Tech and has published widely on religion and violence in the Middle Ages.

President Trump’s demand for a wall across most of the U.S.-Mexico border has been mocked (and embraced) as a “medieval” idea. Responding to the president’s prime-time speech from the Oval Office on Tuesday, Rep. Hakeem Jeffries (D-N.Y.) tweeted, “We are not paying a $5 billion ransom note for your medieval 🏰 border wall.” A day later, on Wednesday, Trump responded by embracing that characterization: “[Democrats] say it’s a medieval solution, a wall. It’s true, because it worked then, and it works even better now.”

Since then, others have seized on the idea, and the association seems to have stuck. Walls generally, but this wall in particular, are straight from the Middle Ages. Dana Milbank ran with the idea, speaking with several scholars of the Middle Ages, experts on siege warfare, about what the country would “really” need if it were planning to use a wall to repel invaders.

But as a scholar of medieval history, I have noticed something has been missing in all this discussion. In short, calling the proposed 700 to 1,200 mile border wall “medieval” is deeply misleading because walls in the actual European Middle Ages simply did not work the way Trump apparently thinks they did. If anything, their true function may speak to Trump’s intentions: Poor tools of defense, medieval walls had more to do with reassuring those who lived inside them than with dividing self from other.

It is indeed fair to say most medieval European settlements had walls around them for protection — variously from bandits, invading kings or marauding local nobles waging private warfare. Nevertheless, this was a method of defense sometimes based more on good intentions than good tactics. Rome’s walls were breached numerous times, most famously in 410 A.D. by the Goths, but again by the Vandals in 455, by Muslim pirates in 846, by the Normans in 1084 and by the Holy Roman Empire in 1527. Medieval Christian Holy War (what we call the Crusades) often involved scaling walls to take cities, from the Christian conquest of Jerusalem in 1099 A.D. to the infamous massacre of heretics at Beziers (in southern France) in 1209 to the Islamic conquest of Acre in 1291.

In other words, the tall, multilayered medieval walls we so often envision often did not work. Even the massive Theodosian Walls surrounding Constantinople were scaled and breached by Venetians and Franks in 1204, then reduced to rubble by the gunpowder weapons of the Ottomans in 1453.

Certainly, there are counterexamples from this more than 1,000-year period. Cities successfully repelled sieges at times. But it is indeed critical to note that even in those circumstances, we are — as in the examples above — specifically talking about towns and cities. We are definitely not talking about walls meant to wholesale separate peoples.

But borders, as a concept, were a much more nebulous thing in the Middle Ages than they are today. Although the ease of travel is obviously much greater than it was 1,000 years ago, people frequently moved — to go on pilgrimages, to wage war, to trade and so on. Whole systems of organized hospitality developed to accommodate those travelers. The ninth-century Plan of St. Gall, an idealized monastery sketched out on parchment (but never built), even has two buildings specifically devoted for visitors. No wall surrounds the monastery.

In addition, even the sturdiest walls served a different purpose than what we might expect. As Jacqueline Jung, an art historian at Yale, put it in a tweet, “Medieval city walls were not built to separate people of [different] ethnic or national identities. Gates were open during the day and closed at night.” In other words, the walls were indeed a defense against any potential common threat, but the world inside those walls offered refuge for all who needed it. The gates were there not to keep them out, but to allow them in.

In this case, as in many others, calling something “medieval” often reveals more about what we think about our own world than what we know of the Middle Ages. We tend to use “medieval” as a shorthand for pointing out difference, a way of saying this or that happened “long ago and far away,” of saying we’ve “evolved” since those “Dark Ages.” But studying the past itself troubles those easy assumptions by showing the full complexity of medievals’ thoughts and actions. In this case, we should probably say the proposed wall on the U.S. southern border is much more “modern” than “medieval.” After all, real medieval walls may have closed temporarily to ward off the uncertainty of a world without electric light, but they always reopened the following morning to welcome in those who sought refuge.