Libyan authorities on Tuesday forcibly disembarked more than 90 migrants who had refused to leave a cargo ship that rescued them before docking in a port west of Tripoli, a coast guard commander said.

The Panama-flagged ship rescued them and other migrants off the Libyan coast 10 days ago as their boat began sinking and brought them to Misrata.

Once there, 14 disembarked willingly but, in the first documented case of its kind, the other 92 refused to leave.

"A joint force raided the cargo ship and used rubber boats and tear gas to force (them off the ship)," the commander of the central region coast guard, Tawfiq Esskair, told Reuters by phone.

Some had been injured during disembarkation but were now "in good condition" after treatment in hospital, and all had been taken to a detention center in the city, he said.

The operation had been carried out under the auspices of Libya's attorney general, he added.

Libya's western coast has been a main departure point for migrants fleeing wars and poverty and hoping for new lives in Europe.

But since last year, heavy pressure from Italy — which had been bearing the brunt of arrivals — resulted in the disruption coastal smuggling networks and the withdrawal of charity rescue ships.