The migrants, mostly Egyptians, were released after "a morning raid on the dens of human traffickers", the elite 444th combat brigade said in a statement.
Their captors had subjected them to "torture and extortion", it added, citing testimonies from those released.
Abuse of migrants is widespread in Libya, where they have been exploited in the chaos which has reigned since the 2011 ousting of dictator Moamer Kadhafi.
The brigade also carried out an operation against smugglers last week in Bani Walid, a centre for human trafficking on the edge of the desert about 170 kilometres southeast of Tripoli.
Six hideouts were discovered in that operation and 70 would-be migrants of different nationalities were released, it said, adding that "one of the country’s most notorious traffickers was detained along with other foreign criminals who were kidnapping, killing and torturing their victims".
Thousands of people have crossed into Libya from neighbouring countries in recent years and travelled onwards to the Mediterranean coast, where human traffickers operate boats bound for Europe.