A Tripoli court ordered the conditional release of the former regime officials on Thursday, and on Friday their bullet-riddled bodies were found in the capital, the prosecution said on its Facebook page.
An investigation into the murders has begun, it added.
The victims had been imprisoned on charges of committing abuses during the NATO-backed uprising that toppled and killed Kadhafi.
They were freed on condition that they report to the prosecutor every two weeks.
The UN special envoy to Libya Martin Kobler condemned the murders and called for a prompt and "transparent" investigation.
Kobler tweeted that he was "shocked and dismayed by the reports of murder of so many detainees released by a Tripoli court".
Signup to our newsletter and follow us on Facebook and Twitter!
The Government of National Accord also denounced what it called a "despicable crime".
A statement on its Facebook page called on security and judiciary authorities to find the assailants and bring them to justice.
Seddiq es-Sour, of the prosecutor's office, told Libyan television the bodies were found in various parts of the capital and confirmed that all were former prisoners.
He said they had been arrested between 2011 and 2014.
The identities of the victims were not immediately released.
Earlier this month, es-Sour had said the supreme court had ordered the release of six Kadhafi regime officials pending an appeal, for reasons linked to their health and age.
Dozens of people are on trial in Libya for their role in the violent suppression of the revolt, including two sons of Kadhafi and ex-government officials.
In July 2015 several people were sentenced to death, including Seif al-Islam, Kadhafi's son and one-time heir apparent.