Corinthia hotel Tripoli
Three security guards have been killed as gunmen stormed the Corinthia hotel TripoliGetty Images

Five foreigners and three security guards at a luxury hotel in Libya's capital Tripoli have been killed after some gunmen stormed the building.

The attackers have also taken an unconfirmed number of people hostage, security officials told AP.

There are conflicting reports between the number of the gunmen, who are believed to be between three and five.

Some people alleged that that the attackers are linked to terror group Islamic State (Isis) who want to revenge the recent death of Anas al-Libi, a Libyan under indictment in the US for his involvement in the 1998 US embassy bombings, in which hundreds of people were killed in Tanzania and Kenya.

However this has yet to be confirmed.

Hassan al-Abey, a corporate sales manager at the Corinthia Hotel, said the gunmen, wearing bulletproof vests, started shooting in the air in the building, which was evacuated before the attackers clashed with the guards.

Mahmoud Hamza, commander of the so-called Special Deterrent Force, told private satellite television station al-Nabaa that the situation was "under control" but could not confirm the whereabouts of the gunmen.

The hotel, popular with foreigners, was also the target of a car bomb blast.

The attack is the latest in a series of gun and bomb attacks in Libya, which has witnessed constant violence since the ousting and killing of Libyan dictator Muammar Gaddafi.

The dictator's killing has prompted the rise of rebels who want to control the country's oil production and sale.

Recent reports showed that Libya, a major oil producer in Africa, is struggling to maintain output amid the ongoing conflict.

In July 2013 a group of Libyan rebels, led by former militia leader Ibrahim Jathran, threatened to start selling oil independently unless they were given a greater share of oil revenues along with autonomy from Tripoli.

The fight over oil supremacy quickly escalated into violence that claimed the lives of dozens of civilians. Libya's government called for international help after some oil storage tanks were set on fire in July 2014.