Tunisian forces killed 21 jihadists who attacked police and army posts near the Libyan border on Monday in a new spillover of violence that also saw four civilians killed.

It was the second deadly clash in the border area in less than a week.

The defence ministry said that a soldier was also killed in the fighting for an army barracks in the town of Ben Guerdane.

Hospital official Abdelkrim Chafroud said that a 12-year-old was among the dead civilians. He said two security agents were also killed.

Six militants were wounded and detained, defence ministry spokesman Rachid Bouhoula told AFP.

The interior ministry said the militants also attacked a police station and a National Guard post in the town, but those attacks too were repulsed.

Army units were deployed across the town and authorities ordered a nighttime curfew.

They also closed the Ras Jedir border crossing with Libya, as well as the main road connecting Ben Guerdane with the rest of Tunisia through the town of Zarzis, 70 kilometres (45 miles) to the north.

Witnesses said troops were using loudhailers to urge residents to stay indoors. The defence ministry appealed for information on any suspect activity.

The office of Prime Minister Habib Essid said he would hold an emergency meeting with the defence and interior ministers.

Last Wednesday, troops killed five militants in a firefight outside Ben Guerdane in which a civilian was also killed and a commander wounded.

Troops have been on alert in the border area following reports that militants had been slipping across since a US air strike on an Islamic State group training camp in Libya on February 18 killed dozens of Tunisian militants.

At least four of the five militants killed in last week’s firefight were Tunisians who had entered from Libya in a bid to carry out attacks in their homeland, the interior ministry said.

Deadly attacks by ISIS on foreign holidaymakers last year, which dealt a devastating blow to Tunisia’s tourism industry, are believed to have been planned from Libya.

Tunisia has built a 200-kilometre (125-mile) barrier that stretches about half the length of its border with Libya in an attempt to stop militants infiltrating.

– Jihadist presence growing –

Last month’s US strike on the ISIS training camp outside the Libyan city of Sabratha targeted the suspected mastermind of two of last year’s attacks, Noureddine Chouchane.

Washington has said Chouchane was likely among the dozens of militants killed, and that the strike probably averted a mass shooting or similar attack in Tunisia.

Chaos has engulfed Libya since the NATO-backed ouster of dictator Muammar Gaddafi in 2011.

Rival administrations which have vied for power since mid-2014 are being urged to sign up to a UN-brokered national unity government to help restore stability and tackle a growing jihadist presence.

ISIS and other extremist organisations have exploited the power vacuum to seize significant territory along the coast around the central city of Sirte as well as around Sabratha, between Tripoli and the Tunisian border.

The ISIS presence just 300 kilometres (185 miles) across the Mediterranean from Europe has raised alarmed bells among Western governments which have made contingency plans for intensified military action against the jihadists.

Handfuls of US, British and French special forces have already been reported in Libya.

A contingent of around 50 Italians is about to join them, Il Corriere della Sera reported Thursday, citing a classified order signed by Prime Minister Matteo Renzi last month.

Britain announced last week that it was sending a team of around 20 soldiers to Tunisia to train troops patrolling the border with Libya.

Thirty Britons were among 38 foreign holidaymakers killed in a gun and grenade attack on a beach resort near the Tunisian city of Sousse last June.

And last March, jihadist gunmen killed 21 tourists and a policeman at the Bardo Museum in Tunis.

According to a UN working group on the use of mercenaries, more than 5,000 Tunisians, mostly aged from 18 to 35, have travelled abroad to join jihadist groups, many of them in Libya.