Libya's coast guard rescued at least 65 migrants, mostly from Sudan, with search operations under way for those still missing.
At least 40 Europe-bound migrants were missing and feared drowned on Tuesday after the boat they were travelling in capsized in the Mediterranean Sea off Libya, the coast guard and the UN refugee agency said.
Ayoub Gassim, a spokesman for Libya's coast guard, said at least five bodies, including a child, were recovered near the western town of Khoms, around 120 kilometres (75 miles) east of Tripoli.
He said they rescued at least 65 migrants, mostly from Sudan, and that search operations were under way for those still missing.
Charlie Yaxley, a spokesman for the UN refugee agency, said at least 40 people are estimated to be dead or missing.
Alarm Phone, an independent support group for people crossing the Mediterranean, said up to 100 migrants were on board the capsized vessel.
The group said it received a call from migrants on the boat, who "were in severe distress, crying and shouting, telling us that people had died already."
Libya's coast guard says it has intercepted hundreds of migrants at sea so far in August.
Libya became a major conduit for African migrants and refugees fleeing to Europe after the uprising that toppled and killed Muammar Gaddafi in 2011.
Traffickers and armed groups have exploited Libya's chaos since his overthrow.
In recent years, the European Union has partnered with the coast guard and other Libyan forces to prevent migrants from making the dangerous journey by sea to Europe.
Rights groups say those efforts have left migrants at the mercy of brutal armed groups or confined in squalid detention centres that lack adequate food and water.
At least 2,500 migrants are detained in centres in and around Tripoli, where forces loyal to warlord Khalifa Haftar have been battling an array of militias loosely aligned with a UN-recognised government since April.
The government blamed an air strike on a detention centre on Haftar's forces, which denied responsibility and accused government-linked militias of storing weapons at the facility.
The UN refugee agency says 164 migrants have died travelling from Libya to Europe this year, fewer than in previous years.
But the UN says the journey is becoming more dangerous for those who attempt it, with one out of four perishing at sea before reaching Europe.
The numbers did not include up to 150 Europe-bound migrants missing and feared drowned when their boats capsized in the Mediterranean Sea off Libya last month.