"A car bomb exploded close to the Al-Habda al-Khadra prison, where there is also an interior ministry brigade headquarters," prison spokesman Othman al-Ghellani told AFP.
"The car blew up around 150 metres from the prison's perimeter wall," he said.
"Initial investigations found that a woman parked the car there under the pretext of wanting to visit an inmate."
Ghellani said no one was hurt in the blast, which damaged two nearby cars.
Also Read
The jail is currently home to several former Gaddafi henchmen, many of whom have already been sentenced to death or to life imprisonment for crimes committed during the longtime autocrat's decades-long rule.
His son Saadi is being held there. The former Libyan football team captain was extradited to Libya from Niger in March 2014 and is due back in court on Monday.
Last year, a video emerged appearing to show officials and guards at the prison ill-treating several detainees, including Saadi.