A gunman attacked a mosque in Herat province, western Afghanistan, during prayer time on Monday night, killing six people and wounding another.
The mosque was reportedly a place of worship for the Shiite Muslim minority.
Taliban Interior Ministry spokesman Abdul Mateen Qani confirmed the attack and an investigation is ongoing.
No group has claimed responsibility.
Former Afghan President Hamid Karzai condemned the attack, calling it a terrorist act against religious and human standards.
The United Nations condemned an attack in
Afghanistan that killed and injured at least seven people, including a child.
The Islamic State group's affiliate in
Afghanistan, a major Taliban rival, is believed to be behind the attack.
The Taliban, who seized power in
Afghanistan in August 2021, have been implementing a harsh interpretation of Islamic law despite initial promises of a more moderate stance.
The Islamic State group frequently targets Shiite communities and has been responsible for attacks on schools, hospitals, mosques, and Shiite areas throughout the country.
The UN called for accountability for the perpetrators and protection measures for Shiite communities.