Afghanistan's Taliban rulers blamed Iran for the blast.
Maulvi Mohammed Mussa, a Sunni Muslim cleric, was killed in the explosion in Herat city, along with another Iranian believed to be the bomber, Herat Provincial Governor Khairullah Khaikhwa said in a telephone interview.
Mussa had been living in Herat for several years, reportedly since his mosque in majority Shiite Muslim Iran was burned down. It was not clear whether he was the target of the bombing.
Riots followed the deadly explosion, resulting in attacks on the Iranian Consulate as well as on several Shiite Muslim mosques in the city, Khaikhwa said.
Most of Afghanistan's 21 million people, including most Taliban, are Sunni Muslim. Iran has been nervous about sending diplomats to Afghanistan since 1998, when several of its diplomats were killed following the Taliban takeover of the northern city of Mazar-e-Sharif.
The bomb, which was strapped to a bicycle, exploded during afternoon prayers on Friday, the Muslim Sabbath, Khaikhwa said. Devout Muslims pray five times a day and on Friday most people go to the mosque to worship.
At least eight people were killed, he said, but Iranian sources reached in neighboring Pakistan said the death toll was at least 20. They also said about 100 people were injured.
"The peope of Herat accused Iran. Behind this explosion is Iran," Himat said.
Immediately after the explosion, hundreds of people set fire to Shiite Muslim mosques in Herat and marched on the Iranian Consulate, destroying several vehicles and part of the consulate.
The Taliban evacuated the consulate, according to Himat, who did not know how many Iranian diplomats were there.
"They are safe. Iran is in touch with the authorities. They are in a safe place," he said.
The Taliban blamed the 1998 killings on renegade troops, but the incident generated widespread fear of a possible retaliatory attack by the Iranian government.
Relations between the two countries have improved steadily.
However, the Taliban which claims control of about 95 percent of Afghanistan, accuses Iran of supporting an opposition alliance fighting Taliban rule.
© MMI Viacom Internet Services Inc. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press and Reuters Limited and contributed to this report