Image copyright AFP Image caption An Italian warship in Tripoli: Italy remains a magnet for desperate migrants
EU states have agreed to launch a new military mission off the Libyan coast to enforce a shaky UN arms embargo.
The 27 governments still have to draft a legal text for the mission, after agreeing it in principle in Brussels.
"The main objective is the arms embargo," said Luxembourg Foreign Minister Jean Asselborn.
The UN-recognised government in Tripoli is under attack from the forces of Gen Khalifa Haftar, which control most of eastern and southern Libya.
The EU's new naval and air mission is to operate in the eastern Mediterranean, away from the migrant-smuggling routes from Libya which have caused bitter divisions in the EU.
Italy's Foreign Minister Luigi Di Maio said that if the EU ships proved to be a "pull factor" for migrants desperate to reach Europe "the mission will be stopped".
Media playback is unsupported on your device
Media captionWhat's behind the fight for Libya?
Under international law EU ships - whether military or civilian - are obliged to rescue people in distress at sea.
Former Italian Interior Minister Matteo Salvini took a hard stance on migrant boats, implementing a closed ports policy.
- World leaders 'committed' to Libya peace: UN chief
- How Africa has been frozen out of Libya peace efforts
- Calls to redistribute migrants as EU arrivals rise
Austria led opposition to renewing EU naval patrols off the Libyan coast, but finally accepted a new mission with a different mandate from Operation Sophia, which had sought to stop people-smuggling gangs.
Operation Sophia began in 2015 and its mandate ends in March. Last year Italy blocked the deployment of new ships, accusing its EU partners of a lack of solidarity, as Italy has had to cope with the largest numbers of irregular migrants.
Many of those rescued off Libya are refugees from the wars in Syria, Iraq and Afghanistan. But many impoverished migrants from sub-Saharan Africa also risk their lives on unseaworthy boats, desperate to flee the violence and abuse that are rife in Libya.
As in Syria, international rivalries are being played out in Libya, and that competition is fuelling arms deliveries to the warring sides.
Gen Haftar's Libyan National Army (LNA) has support from the United Arab Emirates, Egypt, France and Russia, while the Tripoli government has the backing of Turkey, Qatar and Italy, among others.
EU foreign affairs chief Josep Borrell said the EU would not be able to patrol the Egypt-Libya land border, across which artillery is still being supplied to Gen Haftar's forces.
Watch Brazilian carnivals live, discuss the next world conflict in the video chat or just enjoy fresh videos with funny cat talking - with Ulive.news you are at the center of any event! Ask a streamer to show what is happening from a different angle, to ask a question to eyewitnesses or to pay attention to an important detail. We will translate your message into 64 languages so that you can easily understand each other.