After last month's terror attack at a beach resort in the coastal city of Sousse, the Tunisian Government has authorised plans to build a 167km barrier to secure its border with Libya.
The wall plan was announced by Tunisia Prime Minister Habib Essid, who said the lawless situation next door in Libya was "the biggest dilemma" facing his nation.
Seifeddine Rezgui, the Tunisian gunman who killed 38 people, mostly tourists, in Sousse, is believed to have been trained by Islamist militant group Ansar al-Sharia in Libya, which is in the grip of a civil war.
Isis (Islamic State), which has a Libyan offshoot, separately claimed responsibility for the attack and has set its sights on expanding its branches in North Africa.
The wall would be a trench and sand fortification stretching inland from the Mediterranean, according to reports. It would be built and monitored by the Tunisian military and would include surveillance posts.
Reports also suggest Tunisia will receive outside logistical and technical support from France and the UAE to help reinforce its borders.
Tunisia has taken other more controversial steps to crack down on suspected radicals. Essid, who was nominated to his post by Tunisia's ruling secularists, ordered some 80 mosques accused of "spreading venom" to be closed.
Tunisian clerics protested against the "unjust" move, saying the assault "bore no relation to Islam".
Since 2011, when mass protests led to the ousting of Tunisian dictator Zine Abidine Ben Ali and ushered in the country's fledgling democratic transition, ultraconservative Salafists have found more space and traction within Tunisian society.
Tiny Tunisia has seen a huge flow of its nationals join foreign jihadists fighting for Isis in Syria and Iraq.
The attack in the country was a huge blow to its tourism industry, which contributes more than 15 per cent of Tunisia's GDP and provides nearly half a million local jobs.
Essid's government is not the only one this year to announce such a drastic measure. Last month, Hungary's right-wing government said it would build a 175km wall on its Serbian border to thwart migrants and refugees escaping to Europe from the Middle East and Africa.
"We have only recently taken down walls in Europe," said an EU spokeswoman. "We should not be putting them up."
Tunisia's fence
What: 167km wall, inland from the coast
Where: Along the eastern one third of the 500km border between Tunisia and Libya
When: It is to be finished by the end of the year
Why: To prevent Tunisian citizens travelling to jihadist training camps in Libya. The plan to build a fence dates back to 2012, but authorities now see it as a matter of urgency after the killing of 38 tourists at a resort in the country two weeks ago.
- Washington Post, Bloomberg, Telegraph Group Ltd