CAIRO • As they confront the rising threat of modern extremist violence, many of the nations most at risk are retreating behind one of the oldest forms of defence.
Tunisia has become the latest to invest in a border barrier after dozens of foreign tourists were killed in two attacks by Islamist militants trained in neighbouring Libya and armed by smugglers.
The fence and watch towers ordered by Prime Minister Habib Essid will stretch 160km inland from the coast along the most vulnerable stretch of the frontier.
From Morocco to Saudi Arabia, boundaries are being fortified at a rate not seen since the months following the Sept 11 attacks in 2001.
"The Middle East and North Africa is now the most walled region in the world," said professor of international relations and international law Said Saddiki of Al-Ain University of Science and Technology in Abu Dhabi.
The barriers range from "fences inside cities to anti-migrant walls and separation barriers to counter-insurgency" barricades, he said.
The builders have often been spurred by fear of the Islamic State in Iraq and Syria (ISIS) group after its conquests in those countries and its ability to inspire Muslim extremists, or by concern over failed or failing nations next door.
ISIS has built its own walls to fend off attackers and keep people from escaping, including around the Iraqi cities of Tal Afar and Mosul.
Syria's embattled government has placed concrete shields around areas of regime support in Homs.
The barricades offer a quick fix, although they are costly and may ultimately do little to solve the problems, analysts say.
Although modern barriers may curb trafficking and illicit crossings in the short term, they almost never deliver prolonged security without cross-frontier cooperation.
"Israel's barriers have worked well for them so far," said Georgetown University professor Brent Sterling, author of Do Good Fences Make Good Neighbours?
In the long term, however, the barriers remove the incentive to try to reach a permanent accord with the Palestinians, he said.
In the fight with Islamist movements around the world, where the militants are often homegrown and indiscernible from the crowd and instruction or indoctrination can be provided over the Internet, the barriers are especially ineffective.
"Wall builders are just trying to improve their leverage and hope for the best," Prof Sterling said. "They aren't a panacea, and if you do build a wall, you have to use the time it buys to deal with problems and not sit behind it forever and hope they'll go away."
Hardship in border zones can even be exacerbated by barriers, and the people who profit the most are smugglers, said Dr Elisabeth Vallet, a scholar at the University of Quebec in Montreal and author of Borders, Fences and Walls.
Construction, meanwhile, comes at a price. Saudi Arabia's "Great Wall" separating its north from Iraq includes observation towers with cameras and motion detectors, part of a US$3.4 billion (S$4.6 billion) security system.
Tunisia expects to pay at least US$81 million for the first phase of its fence. Once built, it has to be maintained and patrolled.
"If we spent money on acquiring good intelligence or addressing some of the social and economic problems that create it rather than building walls, we'd be economically, socially and morally much better off," said Ms Liza Schuster, a former lecturer at City University London, who studies the issue.