ISIL has claimed responsibility for an attack on Libya's electoral commission in the capital Tripoli that left at least a dozen people dead.
A group of militants, including at least two suicide bombers, stormed the building and set fire to it, officials said.
Security forces then engaged in a gun battle with the assailants for control of the offices.
"I saw two suicide bombers myself... they were shouting Allahu Akbar (God is greatest)," said spokesman Khaled Omar, who fled the building during the attack.
Pictures posted on social media showed thick black smoke billowing from the commission's offices, in the Ghout al-Shaal district west of central Tripoli.
The attack appeared aimed at derailing efforts to organise elections in Libya by the end of this year, part of a UN-led attempt to unify and stabilise the country after years of conflict and political division.
Since December the electoral commission has registered nearly one million new voters across Libya, though no date has been set for polls.
Wednesday's attack was the first of its kind in Tripoli for several years. Though security across Libya remains volatile, violence in the capital has recently been limited to localised clashes between armed groups.