Unconfirmed reports say Several gunmen stormed the Corinthia Hotel and opened fire in the reception area. A car bomb also exploded nearby.
The security forces say the stand-off has now been brought to an end.
Meanwhile,The US state department has confirmed the death of a US citizen, without giving any further details. The dead American is believed to have been a security contractor
The French national is reported to have been working for Libya's Buraq Air.
There are conflicting reports as to the total number of attackers.
There has been strong evidence to suggest an IS presence in the eastern city of Derna since October, with a group there publicly declaring allegiance to its leader Abu Bakr al-Baghdadi.
However the command structure is still a mystery to most foreign observers.
The BBC's Rana Jawad in Tripoli says that in the past month there has been a string of incidents in western Libya, including abductions and bombings, that have been claimed by IS social media accounts.
However our correspondent says that it has not been clearly established whether these groups are IS foot soldiers or people inspired by them.
A civilian who witnessed the attack told the BBC: "I suddenly heard shots and saw people running towards me, and we all escaped from the back [of the hotel] through the underground garage. The hotel did a lockdown after that."
Different sources at the scene said there were between three and five attackers - video footage released later on Tuesday showed the body of a man reported to be one of the militants.
A security source told the BBC that one gunman had been arrested. Four security guards are among the dead
The Twitter account linked to IS said the group had carried out the attack in revenge for the death of Abu Anas al-Liby, a Libyan jihadist who was suspected of involvement in the bombings of two US embassies in East Africa in 1998.
Liby died in a US hospital on 2 January, days before he was due to stand trial.