Twin car bombs exploded as people left a mosque in a residential area of the eastern Libyan city of Benghazi, killing 27 and wounding more than 30, Libyan authorities said.

A spokesman for military and police forces in Benghazi said the first explosion in the Salmani neighbourhood took place at about 8.20pm on Tuesday.

Captain Tarek Alkharraz said the second went off half an hour later as residents and medics gathered to evacuate the wounded.

Local health official Hani Belras Ali said 27 people died and 32 were wounded.

No group has immediately claimed responsibility for the bombings.

The United Nations condemned the attack on social media, saying that direct or indiscriminate attacks on civilians are prohibited under international humanitarian law and constitute war crimes.