"We were told that a boat with people of African nationalities on board was in trouble off Ghout Rumman," coastguard Colonel Ashraf al-Badri said, adding that the information came from fishermen.
"We found the boat and rescued the migrants," he added, standing among the migrants in Tripoli's port.
Badri said the vessel had been carrying about 115 people from Mali and other African states.
UN refugee agency staff gave them clothes and food, as well as first aid to some, as buses arrived to take them to detention centres in Tripoli.
Smugglers have stepped up their lucrative business in the chaos that has followed the 2011 ouster of longtime dictator Muammar Gaddafi.
In late March, the Italian coastguard said it had rescued nearly 1,500 migrants, including many women and children, in the Mediterranean off the coast of Libya in just two days.