The incident, previously reported by Doctors Without Borders (MSF) and local sources, took place in the town of Bani Walid, south of Tripoli, on May 23.
"Human traffickers in Libya reportedly killed more than a dozen people and wounded many others after a group of some 200 Eritreans, Ethiopians and Somalis, being held captive, attempted to escape," the UNHCR said in a statement on Friday, noting that those murdered "were shot".
"The survivors spoke of torture abuse and exploitation at the hands of traffickers - some being held in captivity for up to three years," the statement added, Presstv reported.
Bani Walid is a hub for smugglers to bring refugees from Libya’s southern sub-Saharan neighbors to the coast, from where they are shipped by boat to Italy.
People smugglers and kidnappers control around 20 detention centers in the town, telephoning the refugees' families to demand ransoms.
Since the 2011 uprising that toppled longtime dictator Muammar Gaddafi, chaos-ridden Libya has become a major transit hub for refugees trying to reach Europe.
Hundreds of thousands of asylum seekers fleeing violence and persecution have made the perilous journey through Libya and across the Mediterranean Sea to Italy. Many have perished en route.
"This latest deadly incident demonstrates, once again, the huge challenge of providing protection to refugees in Libya, where many people fleeing war and persecution fall prey to criminal networks," the UN agency added.