A security source told Khaama Press at least 20 people were killed, and another 30 were injured and transported to nearby health facilities. Both are dead, a local police spokesperson told AFP.
Afghan interior ministry spokesman Najib Danish said ten people had been reported wounded in the attack which took place at the gate of Jawadya mosque in Herat city, which is close to the Iran border.
A reporter for AFP said he had seen a number of bodies brought out of the mosque, leading to fears of a heavy death toll.
He reported seeing a body torn to pieces at the entrance, possibly that of the attacker, while others were lying in pools of blood inside, some still crying and moving.
According to them, a suicide bomber opened fire on worshipers inside the mosque before detonating his explosives.
No group immediately claimed responsibility for Tuesday's attack.
The Herat attack was the latest in a series of assaults on Afghanistan's minority Shiite population.
In recent months, Daesh has been making inroads in Afghanistan through alliances with local militant outfits.
Some 300 people were believed to be present at the mosque.
Afghanistan is still suffering from insecurity and violence years after the United States and its allies invaded the country in 2001 as part of Washington's so-called war on terror. Herat has previously been the scene of several smaller attacks on Shiites.