Suspected IS attack rocks Libya's electoral commission
The internationally backed Government of National Accord (GNA) said it was dealing with "the consequences of the cowardly suicide attack" after the health ministry put the toll at 11 dead and two wounded.
Witnesses said shots were heard and black smoke could be seen rising from the headquarters of the national election commission.
The United Nations mission in Libya condemned the "terrorist attack" and said it extended "its condolences to the families of the victims who lost their lives".
"Such terrorist attacks will not deter Libyans from moving forward in the process of consolidating national unity and building the state of law and institutions," it said on Twitter.
The electoral commission is considered to be one of the few credible and independent institutions in the country, which has been marred by violence since the 2011 ousting of dictator Muammar Qaddafi.
Elections were banned during Qaddafi’s 42 year rule and after his ousting legislative polls were organised in 2012 and 2014.
But chaos has continued in Libya with rival militias, tribes and jihadists vying for power.
A 2015 UN-backed deal to set up the unity Government of National Accord (GNA) in Tripoli failed to end the turmoil, as divisions continue with a rival administration in the east.
In February, UN special envoy Ghassan Salame said he hoped for parliamentary and presidential elections in Libya by the end of 2018, but warned conditions were not yet ready for polling.
The following month, Human Rights Watch warned the country was far from ready in political, judicial or security terms for elections, citing harassment of activists and journalists as among the problems to be overcome.
A new constitution has to be put to a referendum and an electoral law adopted before polling.
As of March, 2.4 million Libyan voters had been registered of a population of six million.