An explosives-rigged vehicle blew up in front of a mosque in the central neighbourhood of Al Sleimani, a security source said.

A second car exploded 30 minutes later in the same area, causing more casualties among security services and civilians.

The mosque is known to be a base for Salafist groups which fought militants in the eastern port city alongside forces loyal to military strongman Khalifa Haftar.

Ahmad Al Fitouri, a security services official for Haftar’s forces, was among those killed in the bombing, military spokesman Miloud Al Zwei said.

Libya has been rocked by chaos since a 2011 uprising that toppled and killed dictator Muammar Gaddafi, with two rival authorities and multiple militias vying for control of the oil-rich country.

Haftar in July announced the “total liberation” of Benghazi, three years after his forces launched a military operation to seize the city from militants who had made it a stronghold following the revolution.

But clashes and attacks in the city have continued, including against diplomatic facilities and security forces.

Haftar supports a parliament based in the far east of Libya, while a rival United Nations-backed unity government in the western capital Tripoli has struggled to assert its authority nationwide.