Libya's neighbours called Monday for dialogue in the North African nation, which has been wracked by violence since the 2011 overthrow of Moamer Kadhafi that has intensified since a controversial June election.
The six governments agreed to set up twin commissions to broker talks and attempt to prevent any spillover of the unrest from the key oil producer, which remains awash with weapons from the NATO-backed uprising against the longtime dictator.
Delegates from Algeria, Chad, Egypt, Niger, Sudan and Tunisia urged "all parties ... in Libya to resolve their differences through dialogue," at meeting in the Tunisian town of Hammamet.
They set up two commissions, the first of which will be chaired by Algeria and will be tasked with "examining the military and security issues, including border surveillance."
The other, which Egypt will be in charge of, is tasked with "contacting the political class and members of civil society in Libya" to facilitate the launching of a national dialogue.
The two commissions are to report back to the Tunisian foreign minister in the last week of July, who will then present them to his counterparts at the next meeting of Libya's neighbours.
Egypt has offered to host the meeting, during the first half of August.
Delegates underlined the need to "resolve (the problem of) pockets of terrorism in Libya, which are a source of concern for Libya and the countries in the immediate vicinity."
Eastern Libya, particularly its main city Benghazi and the hill town of Derna, have become strongholds of jihadist groups, made notorious by a 2012 attack on the US consulate that killed the ambassador and three other Americans.
In a stark indication of the worsening violence in Libya, Foreign Minister Mohamed Abdelaziz, who had been due to join the talks, was unable to get to Tunisia after heavy fighting between rival militias forced the closure of Tripoli airport.
Libya's ambassador in Tunis took his place.
At least six people were killed in heavy exchanges of fire at Tripoli airport on Sunday, a health ministry official said.
"Libya is now practically cut off from the outside world," an airport official said, adding that a three-day suspension of all flights could be extended.
On July 6, Libya's electoral commission scrapped the results from 24 polling stations in the June 25 election to replace the controversial first post-Kadhafi parliament which was dominated by Islamists and accused of hogging power.
The fraud allegations have been accompanied by mounting violence between Islamist militias and their rivals.