Libya's coastguard rescued at least 150 migrants who were trying to reach Europe on Monday, after their inflatable boat had engine problems and began to sink, a navy spokesman said.
The migrants, mostly Africans and including two women and four children, were spotted off the coast of the capital Tripoli.
A coastguard patrol was informed that a boat had run into trouble around seven nautical miles offshore and a rescue mission was launched, Colonel Abu Ajela told AFP.
A witness said people traffickers had taken the migrants out to sea and left them there after removing the engine on the inflatable boat and replacing it with another that quickly broke down.
The migrants were brought ashore to a naval base in Tripoli where authorities gave them food, water and medical assistance before handing them over to a detention centre.
Human traffickers have exploited years of chaos in Libya since the 2011 uprising that toppled and killed dictator Moamer Kadhafi to boost their lucrative but deadly trade.
Tens of thousands of migrants have resorted to paying people smugglers to enable them to cross the Mediterranean Sea from Libya to what they hope will be a better life in Europe.
Since January, more than 100,000 migrants have made the perilous voyage, with around 85,000 arriving in Italy from Libya, according to the International Organization for Migration.
This year some 2,360 people have drowned in the attempt, the IOM says.