Thick plumes of black smoke and flames rose high into the air around the scene, television pictures showed.
Iranian authorities sent fire engines and ambulances across the border, while scores of locals fought the blaze in the border town of Islam Qala before it was brought under control.
Initial reports said the blaze had started after a gas tanker exploded. Officials said later that the cause was not immediately clear.
Waheed Qatali, governor of the western province of Herat, said Iranian authorities and NATO-led personnel in Afghanistan were asked for assistance to help contain the fire, which damaged electricity infrastructure, leaving much of Herat's capital city without power.