At least 21 people, including two Americans, were killed Friday evening in a commando-style attack by Taliban insurgents on a popular Lebanese restaurant in the Afghan capital, local officials said Saturday.

The attack, one of the deadliest in Kabul in years, began when a suicide bomber blew himself up outside the restaurant gate just after 7 p.m. Friday, according to the Interior Ministry. Gunmen then entered and started shooting in the busy dining room.

After a sporadic exchange of gunfire that lasted nearly two hours, security forces said they had shot dead the two attackers inside.

“The U.S. Embassy has confirmed that at least two private U.S. citizens were among the victims of last night’s terrorist attack in Kabul,” officials said in a tweet on Saturday.

State Department spokes­woman Jen Psaki said the dead did not include any members of the U.S. Embassy staff in Kabul.

Hashmat Stanekzai, a spokesman for Kabul’s police command, said, “We have established that 21 people, 13 foreigners and eight Afghans were killed in the attack.” He said five of the victims were women, four of them expatriates.

Britain’s Foreign Office confirmed late Friday that a British national was among the dead, the Associated Press reported. Canadian Foreign Affairs Minister John Baird said two Canadians died in the attack, according to Reuters.

A spokesman for the Taliban, Zabiullah Mujahid, asserted responsibility for the attack. In a statement, the Taliban said the commando-style assault was to avenge the killings of a group of civilians who died in a U.S. air raid earlier this week northwest of Kabul.

Among those killed was the owner of the restaurant, Kamal Hamade, Interior Ministry officials said. Four Afghan employees of the United Nations lost their lives as did the International Monetary Funds’s country director, Wabel Abdallah, who, like Hamade, was Lebanese, news reports said.

It was not clear how many people on the premises survived.

A relative of one of the restaurant employees who managed to escape said said he was told that soon after the the attack began, Hamade led some of his Afghan employees to safety.

The target of the attack was La Taverna du Liban, a Lebanese restaurant in the heart of Kabul’s most exclusive and heavily guarded residential district.

For years, the bistro was a rare haven of relaxation for foreign diplomats, aid workers and Afghan officials in a gray city full of blast barriers and beggars. Hookahs bubbled in an alcove equipped with low couches, and Arabic pop music played in the background. Wine and beer were served discreetly, in china teapots, along with savory Lebanese appetizers of kebab, falafel, tabbouleh and stuffed grape leaves.

In the past year, as international missions began to downsize or leave the capital in anticipation of Western troop withdrawals, the number of ­foreigner-friendly establishments shrank, but La Taverna thrived.

On Friday evenings in particular, it was often full and lively, with laughter rising amid a mix of languages. Hamade, the owner, was known for the warmth with which he presided over his domain, fingering prayer beads as he chatted with longtime customers about Middle Eastern politics.

Both the liberal atmosphere and the VIP clientele, however, made the restaurant a natural target for the insurgents, who have attacked numerous international facilities here — from aid compounds to luxury hotels — over the years. It also was subjected to periodic official crackdowns on alcohol, and there was an armed attack by unknown assailants, in which Hamade was injured.

In 2011, the restaurant added armed guards and triple-door steel barricades at its entrance to protect customers and win continued approval from foreign embassies and missions for their employees to eat there.

Those precautions were no match for the suicide team that attacked Friday night.

Constable reported from Washington.