Libyan authorities began clearing debris from Tripoli's Corinthia hotel, a day after heavily armed gunmen stormed the building, killing nine people. (Reuters)

Gunmen stormed a hotel popular with foreigners in Libya’s capital Tuesday and killed at least 10 people, including an American security contractor, before a standoff ended when two assailants set off a grenade that left them both dead, news agencies reported.

The State Department later confirmed that one of those killed was an American but did not immediately provide further details. News agencies said the American worked for Crucible LLC, a private security firm based in Fredericksburg, Va.

According to U.S. officials, the victim was David Berry, whose online profile describes him as a 12-year Marine combat veteran “with extensive experience in the Special Operations and Intelligence Communities.” It says he often worked in “hostile and austere locations throughout the world.”

The New York Daily News, which first identified the American, quoted Crucible chief executive Cliff Taylor as saying Berry had been working as a security manager in Tripoli since July 2014.

“Our company was unfortunately a victim of the terrorist event,” Taylor told the newspaper.

Libyan security forces surround Tripoli's central Corinthia Hotel on Jan. 27, 2015. (Ismail Zitouny/Reuters)

Libyan officials said four other foreigners — a Frenchman and three citizens of former Soviet republics, died in the rampage, the Associated Press reported. Essam al-Naas, a spokesman for a security agency in the Libyan capital, said five guards were also killed, AP said. At least 10 other people were reported wounded in the assault.

The attack underscored the deepening unrest across Libya as Islamist militants and other factions tighten their grip on cities and other key sites.

The assault on the seaside Corinthia Hotel struck at one of the few sites in Tripoli considered secure enough to host foreign visitors such as business executives and political envoys.

The full details of the attack were unclear, including the total number of gunmen and whether some escaped. But the strike appeared to have some level of coordination. A car bomb was detonated as guests and staff fled the hotel.

After a standoff lasting several hours, two attackers killed themselves by setting off a grenade, security officials said.

The hotel is frequented by journalists, business executives and other international envoys, including officials involved in U.N.-brokered talks with Libya’s rival factions.

In New York, the U.N. Security Council said its members “condemned in the strongest terms the terrorist attack . . . against the Corinthia Hotel.” In a statement, the council reaffirmed full support for Bernardino León, the U.N. special envoy for Libya, and urged Libya’s factions “to engage constructively with his efforts to resume an inclusive political process aimed at addressing the political and security challenges facing the country.”

Reports about the attack included several conflicting accounts, and it was not immediately possible to reconcile the various details, news agencies reported.

The AP, citing security officials and hotel staff, said five masked attackers wearing bulletproof vests stormed the hotel after security at the gates tried to stop them.

A hotel staff member told the AP that the gunmen entered the hotel and appeared to fire at random. As guests and staff fled out the hotel’s back doors, a car bomb exploded about 100 yards away, the AP reported.

Three guards died in the blast, the Reuters news agency reported, citing security officials.

The hotel staff member spoke to the AP on condition of anonymity because he feared retribution.

He said the hotel had Italian, British and Turkish guests but that it was largely empty at the time of the attack.

It was not immediately clear who staged the attack, but the SITE monitoring service said a militant group claiming links to the Islamic State claimed responsibility.

In a Twitter post, SITE quoted the Islamic State offshoot in Libya as saying the attack was launched in solidarity with a Libyan man suspected of plotting al-Qaeda’s 1998 bombings of U.S. embassies in Kenya and Tanzania.

Abu Anas al-Libi, whose real name is Nazih Abdul-Hamed al-Ruqai, died in a New York hospital earlier this month just days before his trial.

Tripoli has been hit with a series of car bombs and shootings in the turmoil that has engulfed the country following its 2011 civil war, which ousted longtime Libyan leader Moammar Gaddafi. Two governments and two parliaments are vying for legitimacy in the country from Tripoli and Benghazi in the east.

Tripoli is currently controlled by a group called Libya Dawn, which seized the capital in August by expelling a rival force.

Most recently, a guard was killed in a shootout outside the U.N. headquarters in the city.

Julie Tate and William Branigin in Washington contributed to this report.