An explosion at a mosque in the Afghan city of Herat killed dozens on August 1.

The blast, which struck the Jawadia mosque, reportedly coincided with evening prayers at around 20:00 local time.

Officials said there were at least two attackers - one a suicide bomber, and another who shot at worshippers with a firearm.

A spokesperson for the local governor told the BBC the death toll could rise.  He said at least 29 people had been killed, and another 64 were injured.

The governor's representative said the suicide attacker also opened fire inside the mosque before detonating his explosives.

Reuters reported grenades were thrown, citing local police.

"Based on our initial information two terrorists were involved, one of them wearing a suicide vest, who detonated himself while the second one was armed with a rifle. They are both dead," Herat police spokesman Abdul Ahad Walizada told AFP news agency.

Meanwhile, the provincial governor's spokesman, Jalani Farhad, told Al Jazeera that the death toll had risen to 50.

The attack took place in the middle of evening prayers when the mosque was packed with about 300 worshippers.

Later, local residents, who are mostly Shia Muslims, attacked the police station pelting it with stones and setting it on fire, the provincial governor's spokesman Jalani Farhad was quoted as saying by Al Jazeera.  They were apparently angry at the late response of the police.

No group has said it was behind attack, which occurred in a predominantly Shia Muslim area. A spokesman for the Taliban, which has struck Shia mosques in the country before, condemned the attack in a text message sent to reporters.

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

The attack there comes one day after a battle at the Iraqi Embassy in the capital, Kabul, which also saw gunmen launch an assault following a suicide explosion.  So-called Islamic State (IS) terror group 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 center 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.