As they confront the rising threat of modern jihadi violence, many of the nations most at risk are retreating behind one of the oldest forms of defense.

Tunisia became the latest to invest in a border barrier after dozens of foreign tourists were killed in two attacks by Islamist militants trained in neighboring Libya and armed by smugglers. The fence and watch towers ordered by Prime Minister Habib Essid will for now stretch 100 miles (160 km) inland from the coast along the most vulnerable stretch of the shared frontier.

From Morocco to Saudi Arabia, boundaries are being fortified at a rate not seen since the months following the Sept. 11 attacks.