Image copyright EPA Image caption The deadly explosion at prayer time severely damaged the mosque in Herat

So-called Islamic State (IS) has said it was behind an explosion at a mosque in the Afghan city of Herat that killed dozens of people on Tuesday.

Two militants carried out the "commando" attack, the IS-affiliated news agency Amaq said. Authorities said the death toll had risen to 33.

The blast, which struck the Jawadia mosque, coincided with evening prayers at around 20:00 local time (15:30 GMT).

Both attackers - a suicide bomber and a militant armed with a firearm - died.

Amaq made the announcement on Wednesday using the messaging app Telegram.

Authorities in Herat said that a further 66 people were injured in the attack. Militants threw grenades when they stormed the packed mosque in the predominantly Shia Muslim area.

Herat, close to the border with Iran, is considered one of Afghanistan's more peaceful cities.

On Wednesday, protesters chanted anti-IS slogans as they carried victims' coffins through the streets of Herat, AFP news agency reported.

Demonstrators chanted "death to Daesh [IS]" and "down with fundamentalism" as the coffins were placed near the Jawadia mosque.

Image copyright Getty Images Image caption Local authorities said that dozens were killed and injured in the attack

A spokesman for the Taliban, which has struck Shia mosques in the country before, earlier condemned the attack in a text message sent to reporters.

The incident took place one day after a battle at the Iraqi embassy in the capital, Kabul, which also saw gunmen launch an assault following a suicide explosion. IS said it had carried out that attack.

Areas dominated by Shia Muslims in Afghanistan have been hit by attacks repeatedly in the past year, by both IS and the Taliban.

Many of the casualties have been civilians, with injury numbers rising for the past five years as attacks increased.

In May, a huge bombing in the centre of Kabul killed more than 150 people, the deadliest militant attack in the country since US-led forces ousted the Taliban from power in 2001. It is not clear what the intended target was.