The blast took place at about 3 p.m. near the northern gate of the Great Mosque of Herat, said Jilani Farhad, a spokesman for Herat's governor.
It was not immediately clear who carried out the attack. But Afghanistan is grappling with a wave of terrorism that has killed more than 150 in just the past week.
It was one of the deadliest attacks in the country since the start of the war in Afghanistan in 2001, which was triggered by the US invasion is search of al Qaeda leader Osama Bin Laden after 9/11.
The Taliban denied involvement in the Kabul attack, but Afghan intelligence said in a statement they believe the Haqqani Network, a Pakistani group aligned with the Taliban, was behind it.