Libya's shutdown of its main border crossing with Tunisia this week will remain in force until authorities put an end to smuggling involving powerful armed groups, an official said on Friday.

Authorities aim to "ensure the security of the borders and combat crime and smuggling," Interior Minister Imad Trabelsi said during a press conference that finished in the early hours of Friday morning.

The crossing was shut down on Tuesday after clashes between armed groups and security forces on the Libyan side the night before.

The minister vowed not to back down "in the face of drug traffickers and smugglers".

The Ras Jedir crossing, around 170 kilometres (105 miles) west of Tripoli, is "one of the biggest smuggling and crime hotspots in the world", said Trabelsi.

He said it had over the years become a hub for smuggling, with petrol, in particular, crossing into Tunisia and amphetamines travelling in the opposite direction.

On Monday, the interior ministry directed its law enforcement department to intervene at the crossing to "combat smuggling and security violations" and facilitate travel.

However, security forces were later ordered to withdraw in order to "preserve lives and property", said Trabelsi.

Smuggling groups from cities in the border area have for years controlled Ras Jedir, benefitting from the lucrative parallel border trade.

The minister said "attacking the police, the only ones competent to secure" the borders, was "inadmissible".

"We will not leave our borders unsecured, just as we will not stand idly by in the face of trafficking and chaos," he added.

Travellers have since resorted to using the Dehiba Wazin border crossing some 250 kilometres south of Ras Jedir, where over 90,000 people from both sides have crossed the border since the Ras Jedir was shut down, Tunisian media said Thursday.

Libya is still struggling to recover from years of war that followed the overthrow and death of longtime dictator Moamer Kadhafi in 2011.

The country's rule is split between rival administrations -- Tripoli in the west and Benghazi in the east.