The Lebanese restaurant in Kabul’s central district of Wazir Akbar Khan came under attack on Friday.
A bomber blew his explosives near the entrance of the restaurant and then two gunmen stormed into the place to spray diners with bullets.
The district is home to many embassies and restaurants catering for expatriates.
Taliban militants have claimed responsibility for the assault.
“Our latest figure is 21 killed, including 13 foreigners and eight Afghans,” said Kabul police chief Mohammad Zahir, adding, “Five women were among the dead and about five people were injured.”
Four United Nations staff as well as the International Monetary Fund’s representative in Afghanistan, Wabel Abdallah, were among the dead.
UN Secretary General Ban Ki-moon has condemned the attack.
“Such targeted attacks against civilians are completely unacceptable and are in flagrant breach of international humanitarian law,” Ban was quoted as saying by deputy spokesman Farhan Haq.
Meanwhile, IMF Managing Director Christine Lagarde has said in a statement, “This is tragic news, and we at the Fund are all devastated.”
“Our hearts go out to Wabel’s family and friends, as well as the other victims of this attack,” she added.
The UN Security Council has also denounced the attack. “The members of the Security Council expressed their deep sympathy and condolences to the families of the victims, and to the people and government of Afghanistan, as well as to those other countries whose nationals have been victims of this attack.”
A Taliban spokesman said in a message posted on Twitter that the assault was in reprisal for a US airstrike that killed eight people in Parwan Province on January 14.