At least nine people, including five foreigners, have been killed in Libya's capital after gunmen stormed a hotel in an attack claimed by Islamic State.
A security services spokesperson, Issam al-Naass, told AFP, that after setting off a car bomb outside the luxury Corinthia Hotel in Tripoli, three militants rushed inside and opened fire.
The dead included three security guards killed in the initial attack, five foreigners shot dead by the gunmen and a hostage who died when the attackers blew themselves up.
Naass said the foreigners killed were an American, two Filipinos, a French citizen and a South Korean.
At least five people were also wounded during the assault.
US State Department spokeswoman Jen Psaki said the attack cannot be allowed to impede the critical work that is underway to find a political solution in Libya.
The head of Libya's self-declared government, Omar al-Hassi, was inside the hotel at the time of the attack but was evacuated safely, Naass said.
Claim of assassination attempt
In a statement on Twitter, the Tripoli branch of the Islamic State jihadist group claimed responsibility for the attack, the SITE Intelligence Group said.
It said the attack was in honour of Abu Anas al-Libi, an Al-Qaeda suspect who died in the United States earlier this month, days before facing a trial for bombing US embassies.
Several militant groups in Libya have pledged allegiance to IS, the Sunni extremist organisation that has seized control of large parts of Syria and Iraq.
Security forces loyal to Hassi's government, which is jostling for power with the internationally backed authority of Prime Minister Abdullah al-Thani, surrounded the building during the assault.
The government in Tripoli said the attack was an assassination attempt on Hassi it blamed on "enemies of the revolution".
'Blow' to peace efforts
EU foreign affairs chief Federica Mogherini condemned the attack, calling it "another reprehensible act of terrorism which deals a blow to efforts to bring peace and stability to Libya."
A new round of UN-mediated peace talks between Libya's rival factions kicked off in Geneva on Monday as they seek to implement a roadmap on forming a unity government.
The North African nation has been wracked by conflict since the overthrow of dictator Moamer Kadhafi in a 2011 uprising, with rival governments and powerful militias now battling for control of key cities and the country's oil riches.
The Islamist-backed Fajr Libya (Libya Dawn) militia alliance took control of Tripoli last summer, forcing Thani's government to flee to the remote east.
The Corinthia Hotel is popular with diplomats and officials.
In October 2013, gunmen seized then prime minister Ali Zeidan from the hotel, where he was residing. He was released after several hours.
British Prime Minister David Cameron and then French president Nicolas Sarkozy met top officials at the hotel in September 2011, when they were the first foreign leaders to visit Libya after Kadhafi's ouster.
In Benghazi meanwhile, 22 people were killed and 68 wounded in fighting since Monday evening, a security source said.