For much of human history, kindness to foreigners has been a cherished trait.

“The stranger who sojourns with you shall be to you as the native among you, and you shall love him as yourself,” commanded the Old Testament. In Homer’s epic, Odysseus traveled at the mercy of strangers, seeking out shelter in unknown lands.

All throughout the ancient texts, divine beings masquerade as vagabonds, their disguises designed to test the mercy of their hosts. Graciousness is summarily rewarded, while hostility or indifference leads to carnage and despair. Hospitality narratives highlight the rules of etiquette that once bound host to guest.

The beginnings of Western civilization were shaped by these same codes of conduct. But now, at least throughout much of the developed world, hospitality—that safe harbor for weary travelers—is in danger of disappearing.

One of the lingering cruelties of President Trump’s proposed travel bans is that they target some of the regions of the globe where hospitality is still sacrosanct. In disdaining places where culture is still defined by generosity, the U.S. is not only imperiling its public image, but upending the basic humanity that once governed the world.

“The industrialized countries, obedient to a cold rationality, have had to unlearn hospitality,” observes the Moroccan-French writer Tahar Ben Jelloun, chronicling the rise of bigotry in France. “Time is precious and space limited,” he laments. “Doors are shut, and so are hearts.”

The ancient Greek concept of “xenia” originally signaled friendship between strangers—usually from distant foreign lands. Today, it survives in the English-speaking world as the prefix to xenophobia.

But despite decades of geopolitical strain, hospitality still remains a crowning feature of the contemporary Middle East.

Safe harbor for weary travelers is in danger of disappearing.

On a solo backpacking trip across North Africa and the Levant, I once disembarked, hot and disheveled, from a bumpy shared taxi in Irbid, an industrial city in northern Jordan not far from the Syrian border. Dust streaked my face; I was wracked with thirst. Suddenly, I found myself greeted with an unexpected act of welcome: A stranger appeared, handed me a chunk of juicy watermelon, then vanished back into the crowd.

“It’s something in our hearts. We can’t help it,” a Syrian grad student told me recently, explaining Middle Eastern hospitality while swatting away mosquitos at a Delhi rooftop party. It was in considering how frequently and blithely I had already tromped around Muslim-majority countries that Trump’s proposed bans struck me not only as illegal, but also as intolerably unfair.

In the age of Trump, Brexit, and the resurgence of nationalism around the world, pining for unified, pre-immigrant cultures has become a common conservative refrain.

But it is nationalism—not multiculturalism—that remains the modern and alien invention.

Even during conflict, rules of hospitality were upheld.

Long before walls, bans, and border control regulated and restricted mobility, territories were still fuzzy, and diversity in languages, religions, and ethnicities was the norm. The medieval world was, above all, overrun with travelers: Merchants, pilgrims, bureaucrats, missionaries, and vagrants all crisscrossed adjacent lands. Traveling was seen not only as a privilege, but also an inalienable right.

The 14th-century Moroccan travel writer Abdallah Ibn Battuta spent 30 years journeying the globe. In his travelogues, he is seldom, if ever, asked why. When he reached Delhi, rather than ousting him from India as an unknown interloper, the sultan granted him a prestigious government post on the spot. The king “makes a practice of honoring strangers and distinguishing them by governorships or high dignitaries of State,” explained Battuta. All foreigners were referred to by the title Aziz, meaning honorable.

Islamic law enshrined hospitality as a moral imperative. With minimal infrastructure for tourism, the hosting of strangers required complex rules of etiquette.

“There is no good in someone who is not hospitable,” reportedly cautioned the Prophet Mohammad. One hadith, or teaching of the prophet, stated that guests must be put up for at least one night.

When Ibn Battuta fell ill with a fever in Damascus, a local professor took him home to recover.

“When I desired to take my leave the next morning he would not hear of it,” wrote Battuta, “but said to me, ‘Consider my house as your own.’”

Even during conflict, rules of hospitality were upheld.

Nationalism has persisted in ejecting minority identities all over the globe.

At the tail end of the Crusades, Dominican monk Ricoldo da Monte Croce spent several years in enemy territory, leisurely sojourning through modern-day Iraq, Syria, Israel, and Iran. Though sharply critical of Islam, da Monte Croce nonetheless heaped praise on his hosts.

“They really received us as if we were angels of God,” he wrote of the Muslims who welcomed him to Baghdad, extolling their “serious ways, their kindness to strangers, and their concord and love towards each other.”

This cultured society relied on a reserve of slave labor. But shades of courtly nuance softened the barbarism of the age.

In the caliphate of Harun al-Rashid, who ruled much of the Islamic world from 786 to 809, one young slave sang so beautifully that the king appointed him to a paid position in the palace. Buying a slave’s freedom, along with feeding strangers, was considered an act of virtue—a way for elites to demonstrate their duties as host (freeing caged birds presented a cheaper alternative).

In Muslim empires, religious minorities were accepted as dhimmis, or protected people. Technically second-class citizens, they still fared comparatively well. In Alexandria, Christian refugees were granted official protection by the governor during the Crusades. A Frenchman visiting Cairo was surprised to see “Muslim Arabs, Christians, and Jews all living together.”

Over millennia of trial and error, and particularly during times of global conflict, the relationship between guest and host has both enriched human existence and proven itself indispensable to our species’ survival.

If hospitality has been unlearned, then surely it can still be learned again.

But in a world of heightened suspicions and tightening borders, hospitality risks being eroded—even in its strongholds. Travelers may still enjoy friendly welcomes in the Middle East, but the region’s demographics have shifted, and it now finds itself appreciably less multiethnic and multifaith. Nationalism has persisted in ejecting minority identities all over the globe, and doors continue to slam shut.

In pre-modern times, before the state was tasked with sheltering the homeless or granting asylum to refugees, the care of strangers fell to regular citizens. Now, in view of the Trump administration’s extraordinary failings, hospitality again falls to the people.

If hospitality has been unlearned, then surely it can still be learned again, adding a social justice framework to the enduring rites of the past.

Welcoming becomes a radical act: In the context of threatened travel bans, Islamophobia, and an ongoing refugee crisis, our hospitable roots again need to take hold.