The 12, who were tried on charges of killing protesters during the 2011 uprising that ousted and killed longtime dictator Moammar Gadhafi, were released last week and their bodies were found a day later, bearing signs of torture.
The incident illustrates the lawlessness that still permeates Libya, months after the formation of a UN-brokered government aimed at unifying the country's rival factions and restoring security.
The unity government is also overseeing a large offensive against Libya's Islamic State affiliate in the militant group's stronghold of Sirte. After an initial push into the coastal city, the pro-government militias, mainly from the western city of Misrata, have been slowed down in the face of IS suicide bombers.
IS militants had barricaded themselves in a densely built-up area in the city center, with their snipers taking positions on rooftops. Nearly 140 fighters were killed and hundreds wounded in the month-long anti-IS offensive.
Libyan Justice Ministry spokesman Wessam al-Saghir said the 12 were freed last Wednesday and that their bodies were found in different parts of the capital, Tripoli, with bullet wounds to their heads and bearing signs of torture.