About 200 migrants, mostly from Ethiopia and Eritrea, have been detained in Zawiya west of Tripoli as they tried to cross to Europe while hidden in vehicles, Libyan officials have said.
"Two hundred migrants, including 160 men and 40 women from Ethiopia and Eritrea, were captured. They were hiding in soap boxes," Nassir al-Shebani, head of legal affairs in the west brigade of Zawiya area, said.
The people were hidden in boxes inside a vehicle to be smuggled outside the capital.
Many migrants from sub-Saharan Africa head to North Africa to escape desperate conditions in their own countries, hoping to find work there or risk a perilous journey to Europe.
The Mediterranean can be treacherous in the autumn and winter months, making spring and summer the best time for small boats with ill-equipped crews to cross the sea.
Italy alone rescued 4,000 migrants from boats trying to reach European shores in early April. At that point 15,000 migrants had already arrived there by sea since the start of the year.
Western powers say instability in post-Gaddafi Libya may have encouraged human traffickers to exploit the country's lawlessness.
Since the overthrow of Muammar Gaddafi in 2011, the number of migrants passing through Libya has risen sharply and the country's coastguard and army are ill-equipped to stem the tide.