Cross-border trade between Tunisia and Libya will resume on Monday after the two countries reached a deal to lift a trade blockade at the main frontier crossing following angry street protests.
The breakthrough came after an agreement was reached late Friday on customs duties for goods passing through Ras Jedir, local governor Tahar Matmati said.
The accord provides for the establishment of a single customs duty for goods, Matmati said, adding that a joint monitoring committee was to oversee the deal.
Libyan border officials halted all freight traffic through the crossing at the end of April in an attempt to stop the smuggling of fuel, which is much cheaper across the border.
The closure sparked demonstrations on the Tunisian side and a strike on Wednesday in the impoverished town of Ben Guerdane, where the economy is heavily dependent upon trade with Libya, both legal and contraband.
On Monday, police used tear gas to disperse a protest by hundreds of demonstrators.
Ben Guerdane, one of the North African nation's poorest towns, was also hit by jihadist violence in March from across the border that killed seven civilians and 13 security personnel as well as 55 extremists.
On Saturday, Libya's LANA news agency cited an official in the Libyan town of Zwara as saying passenger traffic had already been fully restored.
On the Tunisian side, lines of vehicles waited patiently under the hot sun to cross, as security forces looked on, an AFP correspondent said.
Tunisia has built a 200-kilometre (125-mile) barrier stretching about half the length of its border with Libya in an attempt to prevent militants from infiltrating.
Thousands of Tunisians have joined jihadist movements including the Islamic State group in Syria, Iraq and Libya.
Last year, Tunisia was hit by three IS attacks targeting both the country's lucrative tourism industry and the security forces, killing a total of 72 people.
This week, the authorities launched a sweep that they said resulted in the arrest of 37 people, some of whom were involved in attacks on the country.