Donald Trump, a 21st-century leader who does business around the world, owned his own jet and governs by tweet, has staked his presidency on a wall, that most medieval of civic symbols.
For the past few decades, as half a dozen presidents have struggled over how to manage the flow of migrants from south of the border, conservatives and liberals alike have often rejected a wall as an outdated tactic, a blunt instrument that might keep some people out but sends a discomfiting message about American ideals of openness and doesn't address the factors that drive migrants here in the first place.
Photo gallery: See some of the latest images from the U.S.-Mexico border at the end of this story
Trump, who rarely gets philosophical, felt compelled to address the morality of a wall in his Oval Office address Tuesday night. The president said people "don't build walls because they hate the people on the outside, but because they love the people on the inside."
Wittingly or not, Trump, who is visiting the Mexican border Thursday to press his campaign for a wall, echoed what many historians have said about why even the most modern societies keep building walls: "By building a wall or fence, you're defining your community," said Gregory Dreicer, a historian of technology who has studied fences and nationalism.
But walls have a checkered history of maintaining separation between people. No matter how high, how long, how strong the wall, people have an uncanny knack for finding their way over, under and around.
From biblical Jericho to modern Mexico, walls have been put up to stop terrorists, immigrants, armies, drugs, weapons, foreigners, undesired races and creeds and tribes. The Romans built Hadrian's Wall to keep out the barbarians. The Chinese built the Great Wall to keep out a series of rival nations.
Walls settle scores and reinforce rows. Walls have enduring emotional sway. They're good at sending messages. "Tear down this wall," Ronald Reagan said at the Berlin Wall in 1987, and some people believed that an entire empire fell as a result.
Some historians contend that walls have repeatedly proved their worth: They protect communities from perceived threats, bringing the people inside the wall together in security and camaraderie.
But walls can also undermine community, creating and cementing "us vs. them" antagonisms, letting wall builders avoid resolution of the problems they face.
"A wall or gate tells you every day that there are dangerous people right outside who want to destroy you," said Setha Low, an environmental psychologist at the City University of New York's graduate center and author of a book on gated communities. "Hard barriers create fear."
Like the president, House Speaker Nancy Pelosi, D-Calif., has focused not only on the practical question of whether a wall works but on the larger message it sends. "A wall, in my view, is an immorality," she said. "It's not who we are as a nation."
But walls and other physical barriers are as American as can be.
In 1860, Abraham Lincoln's presidential campaign, seeking to brand the candidate as a man of the people, distributed pieces of fence to voters, a reminder that Lincoln was a rail-splitter, a man who, like many American farmers and landowners, built fences. From the nation's earliest days, when only white male landowners could vote, many built fences on their land to show their neighbors they were eligible voters, Dreicer said.
In recent decades, U.S. developers have built gated communities to keep out criminals, salesmen, vandals. Today, more than 14 percent of Americans who live in subdivisions live behind walls or gates, according to the Census Bureau's American Housing Survey.
But walls also run contrary to American ideals of openness and individualism. "Don't fence me in," says a classic Cole Porter song. "Oh, give me land, lots of land, and the starry skies above / Don't fence me in."
Today, walls are a popular response to the vexing problem of mass migration in a globalized economy. When thousands of Middle Eastern and African refugees poured into Eastern Europe in 2015, Hungary began building a 13-foot-high fence on its border with Serbia. Similarly, Bulgaria chose a fence to slow down migrants arriving from Turkey.
But many say walls are out of step with a sophisticated era. At the Vatican this week, Pope Francis recalled the Berlin Wall as a symbol of "the painful division of Europe" and pleaded with Christians to steel themselves against the "temptation to erect new curtains."
The Berlin Wall was built on a lie: Communist East Germany claimed it was protecting its people from western invaders; the structure's official name was the "Anti-fascist Bulwark." But, in fact, East Germany erected the wall to pen in its own citizens, who had been defecting to the capitalist west in mass numbers.
Unpopular for every one of its 10,316 days, the Berlin Wall stood as long as it did because it served the purposes of both sides: The East mostly halted its brain drain. And many Western leaders were glad to back away from a confrontation with the oppressive Soviet and East German regimes.
"A wall is a hell of a lot better than a war," President John F. Kennedy said in 1961.
Governments keep coming back to walls for two reasons: Walls make some people feel secure. And it's often much easier to build a wall than it is to solve a problem through law or politics.
"The existence of the wall constrains and shapes behavior just as much as, if not more than, law," said Sarah Schindler, associate dean of the University of Maine law school, who has studied how barriers can accomplish policy goals that elected officials can't achieve through political means.
For example, while it's unconstitutional to bar people from a neighborhood based on race or poverty, the U.S. Supreme Court ruled 6 to 3 in 1981 that the city of Memphis could barricade a street that connected a white neighborhood to a black one. White residents had asked for the road to be closed to ease "traffic pollution" and keep out "undesirable traffic."
The court rejected claims by black residents that the barrier was intended to divide the races. "The fact that most of the drivers who will be inconvenienced by the action are black" was merely of "symbolic significance," the court said.
Trump's promise to build a wall along the nearly 2,000-mile U.S.-Mexican border is hardly new. By 1996, the Clinton administration's "Operation Gatekeeper" initiative installed fences, walls, sensors and lights to halt the flow of illegal immigrants. The net effect was to shift migration from the San Diego area to the Arizona desert.
In 2007, the George W. Bush administration launched a $7.6 billion program to add walls, fences, cameras and other technology to create "effective control" of the border. That didn't much work either.
"A wall is so primitive," said Jane Loeffler, an architectural historian who has studied the fortification of U.S. embassies after the 1983 bombing of the U.S. Embassy in Lebanon. "You can dig under it, go over it, catapult yourself over it. A wall is more symbolic than a real defense. A wall is fear in three dimensions."
The example Trump often cites of a successful wall is the 267-mile barrier - part wall, part fence - that Israel built in the West Bank to keep out Palestinian suicide bombers. The number of bombs has indeed declined: 450 Israelis were killed by suicide bombers in 2002. Just 13 died in 2007, after the barrier was completed.
Palestinians say the huge drop resulted mainly from security efforts by the Palestinian Authority. Meanwhile, the barrier's broader impact has been mixed.
"Israelis say they feel much safer," Low said, "but the wall also deepened the social divide, making it even harder to cross."
Walls have a huge advantage over laws, norms and other intangible efforts to govern behavior. Rules work only by the goodwill of the people, the recognition of a social compact about who we want to be, and an expectation that rule breakers will be shamed or punished.
Walls require no such consensus - and may hold special appeal for a president who came to office as a builder, a developer who repeatedly acted on his belief that facts on the ground would usually beat the code books.
Proponents of walls take heart in their clarity. In 2010, when former Alaska Gov. Sarah Palin learned that a journalist who planned to write a book about her was moving into the house next door, Palin said she would simply build a fence, which she claimed was anything but an act of aggression.
Citing the classic Robert Frost poem, "Mending Wall," best known for the line "Good fences make good neighbors," Palin took Frost to mean that a fence can enhance relations with people who live nearby.
But the poet was being ironic; his point was that walls separate us from each other. "Something there is that doesn't love a wall / That wants it down," Frost wrote. He saw his wall-building neighbor as an unthinking sloganeer, piling rocks atop one another "like an old-stone savage armed."
A century ago, Franz Kafka declared the Great Wall of China a failure of human imagination, writing in a short story that a wall cannot protect.
"The structure itself is in constant danger," he wrote. "Human nature, which is fundamentally careless and by nature like the whirling dust, endures no restraint. It will soon begin to shake the restraints madly and tear up walls."
Still, walls continue to be built because they are part of who we are. "Walls can be important symbols, and they can have some effect," Dreicer said. "The Berlin Wall did keep East Germans from leaving for a long time. But as with most walls, you could see from the beginning that it was just doomed."
Photos: The latest images from the U.S., Mexico border
Here are some of the latest photos taken at the U.S., Mexico border as Washington continues its debate over funding for a border wall: