The blast happened outside a military post near a market on Sunday.
Herat police chief Ziauddin Mahmoudi said a time-bomb concealed in a pile of rubbish beside a main road exploded near a building with shops on the ground floor and a police station on the upper story.
The explosion came as a ceremony was held elsewhere in Herat to mark the start of disarmament of militia forces under a UN-backed programme.
"The death toll has reached five, a child is among them. And we have 34 wounded people," said Nasir Habib, a doctor at Herat's main hospital.
The death toll could rise because some of the wounded were in a critical condition, he said. All the victims were civilians.
Officials believe rivals of Ismail
Khan carried out the attack
Ghulam Muhammad Masoan, spokesman for the province's governor, said the cause of the blast was unknown.
Masoan said he believed it was the work of "those people who do not want a stable Herat". He was apparently referring to rivals of the province's powerful governor, Ismail Khan.
Herat has long been seen as one of the more stable parts of the country, but in March fighting erupted between forces loyal to a government military commander and members of Khan's militia.
The factional fighting left 16 people dead, including a Cabinet minister.
Khan's son, Aviation Minster Mirwais Sadiq, was killed in the clash. President Hamid Karzai's central government sent troops to intervene but commanders loyal to Khan, who forced those of the rival military commander out of the city, said they were not needed.