The so-called Islamic State has claimed responsibility for an attack near the entrance of the Russian embassy in Kabul, according to the militant group's channel on Telegram.

Two Russian embassy staff in Kabul were among six people killed when a suicide bomber detonated explosives near the entrance of the embassy, in a blast that injured at least 10 others, the Russian Foreign Ministry and Afghan officials said.

Police said the attacker was shot dead by armed guards as he approached the gate, in one of the first such attacks since the Taliban took power last year.

The Russian Foreign Ministry said in a statement that an unknown militant set off an explosive device near the entrance to the consular section of the embassy yesterday.

Russia is one of the few countries to have maintained an embassy in Kabul after the Taliban took over the country more than a year ago.

Although Moscow does not officially recognise the Taliban government, they have been in talks with officials over an agreement to supply gasoline and other commodities.

The United Nations' mission in Afghanistan (UNAMA) condemned the blast and said the Taliban must "take steps to ensure the safety and security of the people as well as diplomatic missions.

The spokesperson for the foreign ministry in Afghanistan said Taliban forces would take serious steps towards securing embassies operating in the country.

"(The government) has a close relationship with Russia; we will never let such negative actions of enemies have a negative impact on the relationship," the spokesperson said in a statement.

During the decades-long Taliban insurgency against the Western-backed Afghan government, bombings targeting foreign missions were a regular occurrence in Kabul, especially in recent years, with embassies and hotels fortifying themselves with razor wire and blast walls.

Such incidents have decreased dramatically since the insurgent group swept to power in August 2021.

However, the Taliban has had to contend with an insurgency by the Afghanistan affiliate of the Islamic State militant group.

The attacks had thus far been against the Taliban and civilian targets such as mosques.