Eighteen prisoners have escaped during an attack on a Libyan police vehicle taking them back to prison from a courthouse in the capital, police said.

Judicial police spokesman Ahmad Boukraa told Lana news agency on Friday the prisoners were being transported back to Ain Zara prison in a western suburb of Tripoli when unknown assailants attacked the police vehicle on Thursday, seriously wounding two guards.

Boukraa gave no further details.

The attack is the latest in a string of incidents plaguing Libya and comes after more than 1,200 inmates escaped during a prison riot last week in the restive eastern city of Benghazi.

Libya's authorities have been struggling to reestablish law and order and form a professional police and army since the fall of longtime ruler Muammar Gaddafi in 2011.

On July 27, more than 1,200 inmates escaped from Al-Kuifiya prison in Benghazi, with a security official saying most of them were common law detainees.

He said they broke out during a riot "as well as an attack from outside".

In April armed men attacked a convoy of prisoners near Tripoli, killing a detainee and wounding others.

Source: AFP