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.
Eyewitnesses earlier 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 UN is hoping that Libya can hold elections this year as it seeks to leave behind years of chaos since the 2011 ouster of dictator Moamer Kadhafi.
UN special envoy Ghassan Salame said in February he was aiming for parliamentary and presidential elections in the North African country by the end of 2018, but warned conditions were not yet ready for polling.
The electoral commission is considered to be one of the few credible and independent institutions in the country.
Elections were banned during Kadhafi's 42-rule and after his ousting legislative polls were organised in 2012 and 2014.
But turmoil has continued in Libya with rival militias, tribes and jihadists vying for territory and the country's vast oil wealth.
Human Rights Watch warned in March 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.
While most recent attacks across Libya have been outside Tripoli, the capital remains mired by insecurity.
In January clashes between rival militias around the city's only working international airport left some 20 people dead.
In 2015 the Islamic State group claimed an attack on Tripoli's luxury Corinthia Hotel that killed nine people, including five foreigners.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.