A charity chaired by the eldest son of Muammar Gaddafi, the president, organised the release of the men on Tuesday after they were said to have renounced violence.
The prisoners are said to be members of the Libyan Islamic Fighting Group (LIFG) and had been serving prison terms ranging from 10 years to life imprisonment. Most had already spent between six and eight years behind bars in the capital's main prison, Abu Salim.
The group, which first became public in 1995, aims to oust Gaddafi who has led the country since overthrowing the monarchy in 1969. The government-funded Gaddafi International Foundation for Charity Associations is said to have held talks for months with the organisation's leaders. The charity said that those released represent a third of the group's members held in Libyan prisons.