The killings took place in the town of Mezdah, some 150 kilometres (95 miles) south of the North African country’s capital Tripoli, the interior ministry said.
It said the 30-year-old smuggler had been killed by “clandestine migrants” for unknown reasons.
In revenge, members of his family went on a shooting rampage at a warehouse where migrants were staying, killing 30 people.
Eleven other migrants, whose nationalities it did not specify, were injured and admitted to hospital in Zentan, 170 km southwest of Tripoli, it said.
The ministry vowed to track down the migrants’ killers and bring them to justice.
“This senseless crime is bleak reminder of the horrors migrants have to endure at the hands of smugglers and traffickers in Libya,” said IOM’s Libya Chief of Mission Federico Soda, urging Libyan authorities to launch an immediate investigation into the killings and hold the perpetrators accountable.
The fall and killing of veteran dictator Moammar Gaddafi in a 2011 uprising sparked years of chaos that traffickers have exploited to turn Libya into a key route for illicit migration towards Europe.
Several thousand migrants from sub-Saharan Africa and Asia are stranded in Libya in horrifying conditions.
Their situation has become even more critical since eastern military strongman Khalifa Haftar launched an assault on Tripoli in 2019, followed this year by the outbreak of the novel coronavirus.