Security officials say a suicide bomber has targeted Libya's Foreign Ministry in the capital, Tripoli, killing three people.

They say a second suicide bomber was shot dead by guards before he could detonate his explosive vest.

The officials, who spoke on condition of anonymity because they were not authorized to brief the media, say at least seven other people were wounded in Tuesday's attack. No one immediately claimed the attack, which bore the hallmarks of the Islamic State group.

Libya has been a haven for Islamic militants since a 2011 uprising toppled dictator Moammar Gadhafi. The country is split between rival governments, each backed by an array of local militias.