* Taliban claims responsibility, says revenge killing
* Police say 21 dead, mostly foreigners
* Dead include Afghans, three U.S. citizens, two Britons, two Canadians
* Restaurant popular among expatriates in Afghan capital (Raises death toll of U.S. citizens to three, paragraph 4)
By Jessica Donati and Mirwais Harooni
KABUL, Jan 18 (Reuters) - A Taliban suicide bomber and gunmen attacked a restaurant popular with foreigners in the heart of the Afghan capital Kabul, killing 21 people including three United Nations staff and the International Monetary Fund's top representative in Afghanistan.
Gunmen burst into the Lebanese restaurant spraying diners with bullets after the bomber blew himself up near the entrance around 7:30 p.m. local time on Friday, just as people had sat down for dinner.
Thirteen foreigners were among those killed, according to police, and details about the victims began to trickle through on Saturday.
The U.S. State Department said three U.S. private citizens were killed. Britain and Canada confirmed they each lost two nationals and Denmark said one of its citizens also died.
The American University of Afghanistan said two of its U.S. employees died in the attack on La Taverna du Liban, a popular dining spot whose charismatic owner, Kamal Hamade, was also killed.
"We are devastated by the news," Michael Smith, president of AUAF, said in a statement.
After the initial blast, sporadic bursts of gunfire were heard over the next hour. The two gunmen inside the Lebanese restaurant, located in Kabul's diplomatic enclave, were shot dead by police, an Afghan official said.
Most foreign forces are preparing to leave Afghanistan this year after more than a decade of war. Afghanistan watchers fear the Taliban will intensify attacks in the run-up to an election in April to find a successor to President Hamid Karzai.
At odds with Washington over the terms of the bilateral security pact that governs the withdrawal, Karzai is still deliberating whether to allow some U.S. troops to stay on.
If no agreement is reached, Afghan forces could be left to fight the insurgents on their own.
The Taliban claimed responsibility for Friday's attack, calling it revenge for a U.S. air strike earlier this week that had also drawn condemnation from Karzai as eight civilians were killed.
The White House condemned the violence.
"There is no possible justification for this attack, which has killed innocent civilians, including Americans, working every day to help the Afghan people achieve a better future with higher education and economic assistance at the American University, United Nations, International Monetary Fund and other organizations," it said in a statement.
Several kitchen staff survived by fleeing to the roof, where they hid until they were rescued by police.
"When I was in the kitchen, I heard an explosion outside. Then all the guys escaped up and I went to the roof and stayed with my back to the chimney for two or three hours," said Suleiman, a cook at the Lebanese restaurant.
By midnight, the operation to clear the area was still under way, with police nervously flashing lasers at passing cars and people on the dark, dusty streets.
The restaurant had been running for several years, and was a favourite haunt for foreigners, including diplomats, contractors, journalists and aid workers.
A couple of armed guards were usually on duty at the front entrance, which led to a courtyard in front of the main ground floor dining room.
The suicide bomb attack took place at that entrance, but accounts differed over where the gunmen had entered from.
"The target of the attack was a restaurant frequented by high-ranking foreigners ... where the invaders used to dine with booze and liquor in the plenty," Taliban spokesman Zabihullah Mujahid said in an e-mailed statement, written in English.
Karzai issued a statement on Saturday condemning the attack, using the opportunity to swipe at the United States for not doing enough to fight "terrorism."
"If NATO forces led by the United States of America want to be united and partner with the Afghan people, they have to target terrorism," he said in a statement. Karzai believes Washington could do more to persuade the Taliban to begin direct peace talks with his government.
UN PEACE SEEKER KILLED
The IMF's representative in Afghanistan, 60-year-old Lebanese national Wabel Abdallah, was one of the diners killed. He had led the fund's office in Kabul since 2008.
"This is tragic news, and we at the fund are all devastated," Managing Director Christine Lagarde said in a statement. "Our hearts go out to Wabel's family and friends, as well as the other victims of this attack."
The United Nations initially said four staff were killed, counting the IMF's representative in the total. The other three included a Russian, an American and a Pakistani.
The Russian was a senior U.N. political officer trying to negotiate a start to peace talks with the Taliban.
"You can imagine the effect it has had on staff members here," U.N. spokesman Ari Gaitanis told Reuters.
A British Foreign Office spokeswoman said two Britons were killed in the attack. Del Singh, a British opposition Labour Party candidate for the European Parliament, was one of British victims, and the other was serving with the EU Police Mission in Afghanistan. A Dane serving with the mission also died.
Canadian Foreign Affairs Minister John Baird said two Canadians were killed, but it was unclear which organisation they worked for.
Foreign casualties were taken to a military base in Kabul. At a hospital morgue near the attack, Afghans screamed and cried as they mourned attack victims, some pressing scarves to their faces to stifle sobs. One young man, grieving for his dead father, kicked a wall and howled.
"One of the restaurant's cooks was wounded," said a doctor, Abdul Bashir. "Two dead bodies have been taken to the morgue."
While the south and southeast of Afghanistan have been the main theatres of action in a war that has dragged on for more than a decade, Kabul has suffered regular attacks.
Taliban fighters mounted several attacks in the capital during the summer months last year, but the assault on Friday inflicted far higher casualties. (Writing by Maria Golovnina, additional reporting by Erik Kirschbaum in Berlin, Louis Charbonneau in New York, Anna Yukhananov, Lesley Wroughton and Steve Holland in Washington; editing by Simon Cameron-Moore, Sonya Hepinstall and G Crosse)