Six others were wounded in the attack claimed by the Islamic State group (IS), which saw two assailants open fire at guards and officials before blowing themselves up.
The death toll had previously stood at 12 killed and seven injured.
The attack has been strongly condemned by the United Nations, the European Union, France, the United States, Britain and Libya’s internationally recognised Government of National Accord (GNA).
The bloodshed comes as the international community pushes for elections in Libya that it hopes will help calm the turmoil that has plagued the North African country since the 2011 ouster of dictator Moamer Kadhafi.
Turmoil has continued in Libya with rival militias, tribes and jihadists vying for territory and the country’s oil wealth, despite a 2015 UN-backed deal to set up the GNA in Tripoli.
Tensions persist in the capital and with a rival administration in the east backed by military strongman Khalifa Haftar.
The country has been a haven for jihadist groups in recent years, with IS claiming several attacks, including one in late March targeting pro-Haftar forces which killed eight people.
While losing its main fiefdom in the northern city of Sirte in December 2016, IS retains a presence in the centre and south of the country.
The electoral commission is considered to be one of the few credible and independent institutions in the country.
It organised legislative elections in 2012 and again in 2014.