Gunmen attacked the Corinthia Hotel Tuesday in central Tripoli, where government officials and foreign delegations often stay.
Security sources at the scene said four armed men had detonated a car bomb directly in front of the hotel, killing at least one guard and injuring others before storming the building.
Security forces surrounded the building where gunfire could be heard nearby, an AFP photographer reported.
"The security forces are evacuating the guests floor by floor. There was shooting between the gunmen and the security forces," Essam Naas, a Tripoli security forces spokesperson told news agency AFP.
"It more than likely there are hostages held by the gunmen on the 23rd floor," Naas added.
Early death toll estimates indicated that eight people had been killed, including five foreigners.
In a brief statement on Twitter, the Tripoli branch of the "Islamic State" jihadist group claimed to have stormed the building, reported the SITE Intelligence monitoring group.
The militant group claimed the attack was revenge for the death of Abu Anas al-Liby, a suspected al Qaeda figure alleged to have carried out the 1998 bombings of US embassies in Kenya and Tanzania. Al-Liby died in hospital this month in New York, ahead of his scheduled trial.
EU foreign affairs chief Federica Mogherini called that attack "another reprehensible act of terrorism which deals with a blow to efforts to bring peace and stability to Libya."
She further expressed "solidarity with the victims and their families," but did not offer details about casualties.
Since the overthrow of dictator Moammar Gadhafi in 2011, Libya has been wracked by conflict. Rival governments, an internationally recognized one in the east of the country, a rival administration established in Tripoli, as well as powerful militia battle for control of the country.
jlw/kms (Reuters, AFP, AP, dpa)