Tunisia has revealed plans to build a 100-mile wall along its border with Libya in the wake of jihadi terror attacks on its soil.

Tunisia Prime Minister Habib Essid said the barrier would stretch inland from the Mediterranean coast which has become a new breeding ground for the Islamic State and other terror groups.

The move comes days after a Islamist militant killed 38 people – mostly British holidaymakers – on a beach in the Tunisian resort of Sousse.

The gunman, Seifeddine Rezgui, is believed to have trained with the Ansar al-Sharia group in Libya along with jihadis who shot dead 22 people at a museum in the capital Tunis in March.

Atrocity: The body of one of the 38 people killed in the attack on the Tunisian beach lies under a towel in Sousse. Tunisia has announced plans to build a wall along the border with Libya in the wake of the attack

Terror: Seifeddine Rezgui wielding an AK-47 on the beach at the resort of Sousse in Tunisia (left) and right before carrying out his sickening slaughter. He is believed to have trained with a terror group in Libya

Responsibility for both of those attacks has been claimed by jihadis linked the Islamic State terror group, who have also threatened to carry more such slaughters over the coming months.

An alleged accomplice of Rezgui is also understood to have fled into Libya and is believed to be trying to escape to Europe in a migrant boat across the Mediterranean.

Mr Essid told state TV the wall would be built be by the army, with surveillance centres spaced along it and would be completed by the end of the year, according to the BBC.

Security has also been stepped up massively since the Sousse attack, with more than 1,400 armed officers deployed at hotels and beaches.

Earlier this week, Tunisia's president admitted his country was 'not safe' and at risk of 'collapse' following two the deadly terror attacks in the past three months.

The 160km-long wall will be built by the army is to be completed by the end of the year

The British Ambassador to Tunisia, Hamish Cowell (left) and Tunisian Prime Minister Habib Essid (second left) attend a memorial ceremony and a minute's silence at the site of a terror attack on a beach outside the Imperial Marhaba Hotel, in the tourist resort of Sousse earlier this month

Declaring the urgent reinstatement of 30 days of security measures that were lifted in March last year, Beji Caid Essebsi said terrorists pose an existential threat to the North African nation.

Speaking over the weekend, Essebsi said the state of emergency would last 30 days.

In a nationwide televised address, the president officially reintroduced urgent security measures for Tunisia that had been lifted in early 2014.

Essebsi blamed the poor security in Libya for Tunisia's problems, and the lack of international resolve in targeting the Islamic State group throughout the region.

He said Tunisia specifically had been a target of the extremist group because it had a functioning, secular democracy.

Tunisia's government has promised new laws to increase police powers and provide for harsher penalties for terrorism convictions. Immediately after the Sousse attack, the prime minister pledged to post armed guards at tourist sites and close mosques outside government control.

The country was under a state of emergency from January 2011, at the outbreak of the Arab Spring, until March 2014.

It initially included a curfew and a ban on meetings of more than three people.