A defence ministry official said 10 people were wounded in a grenade explosion on Thursday in the western city of Herat and several Shia mosques had been set on fire.
Nisar Ahmad Paikar, the Herat police official, said a brawl broke out at a gathering for the Ashura commemoration after a group of Sunnis accused Shia of tearing up a sacred flag.
Sayed Ahmad Alemi, a doctor at the main hospital in Heart, said: "We have some five or six dead bodies lying outside the hospital. They have been brought here, and inside the hospital we have 27 wounded."
Alemi said some of the wounded were being treated for gun shots and some had been beaten.
Police in Herat said the violence had nothing to do with the controversy over cartoons of Prophet Muhammad published in newspapers worldwide.
Authorities in Herat had not asked for help from Nato peacekeepers in the city.
An officer in the Nato-led International Security Assistance Force, ISAF, said heavy firing had been heard earlier but things had calmed down by the afternoon.
"We have some five or six dead bodies lying outside the hospital. They have been brought here, and inside the hospital we have 27 wounded"
Sayed Ahmad Alemi, Afghan doctor
"ISAF is not involved. Local police have calmed down the trouble between the Sunnis and the Shias," said the officer, who declined to be identified.
"We can see smoke over the city but at the moment it's calm."
About 80 per cent of Afghans are Sunni Muslim, with most of the remainder Shia.