In September, an ISIS-K suicide bomber blew himself up at the entrance to the Russian embassy in the Smoke rises from a site of an attack at Shar-e Naw which is city's one of main commercial areas in Kabul, Dec. 12, 2022.[AFP]

A bomb-and-gun attack targeting a hotel in Afghanistan's capital, Kabul, Monday, killed at least three assailants and wounded 21 other people, including two foreigners.

The multistory hotel in Shar-e Naw downtown commercial area of the Afghan capital's home to, among others, several Chinese nationals.

Taliban government spokesman Zabihullah Mujahid said three gunmen had raided the building in the afternoon before being quickly engaged and killed by security forces. He said no foreign residents were killed.

"However, two foreign guests were injured when they jumped out of windows to save their lives," Mujahid added. He did not elaborate.

An international humanitarian organization, known as EMERGENCY, reported a higher casualty toll, saying the attack took place about a kilometer from its hospital in the area.

"So far, we have received 21 casualties - 3 were already dead on arrival," tweeted the Italy-based charity, without elaborating.

City residents said the siege, which lasted several hours, had started with explosions followed by gunfire. Social media videos showed flames and smoke in a part of the building.

Islamic State said the assailants were members of its regional affiliate, known as Islamic State Khorasan Province, or ISIS-K, saying the targets were "Chinese communists and Taliban elements."

The violence comes a day after the Taliban said China had asked them "to pay more attention to the security" of the Chinese embassy in Kabul.

Chinese ambassador Wang Yu raised the security issue in a meeting Sunday with Taliban deputy foreign minister Sher Abbas Stanikzai.

The United States condemned Monday's attacks, urging the Taliban to live up to their counterterrorism commitments.

"One of those commitments is to provide a society that is free from this sort of terrorist violence," State Department spokesman Ned Price told reporters in Washington. "So, we'll continue to watch very closely, and we continue to stand with the Afghan people who are suffering needlessly as a result of these levels of terrorist violence," he added.

Last week, two gunmen opened fire on Pakistan's embassy in Kabul, in an attempt to assassinate the head of the diplomatic mission.

Pakistan's Charge D'affaires Ubaid-ur-Rehman Nizamani escaped unhurt, but his Pakistani security guard was shot in the chest, according to officials in Islamabad.

ISIS-K took credit for plotting the attack.

In September, an ISIS-K suicide bomber blew himself up at the entrance to the Russian embassy in the Afghan capital. That attack killed six people, including two members of the Russian embassy staff.

The Taliban claim to have brought security to the conflict-torn South Asian nation since seizing power in August last year when the United States and NATO partners completed their military withdrawal.

But frequent bomb blasts and other militants, mostly claimed by ISIS-K, in Kabul and elsewhere in Afghanistan have raised questions about the capability of the Taliban to combat the terrorist group.

The violence has killed hundreds of people in the past year, including the Taliban and members of the Afghan minority Shiite community.

U.S. Director of National Intelligence Avril Haines said earlier this month that ISIS-K activities in Afghanistan concern Washington, noting that the Taliban "really don't have the capability to go after it."