Six people were killed when a gunman broke into a mosque in western Afghanistan while they were worshiping, a Taliban official claimed on Tuesday.

According to claims from the local media and a previous Afghan president, the mosque was targeted because it served as a house of worship for the minority Shiite Muslim population in the nation.

The attack happened on Monday night in the district of Guzara in Herat province, said Abdul Mateen Qani, a spokesman for the Taliban Interior Ministry. He said in a post on the social media platform X that an investigation was underway.

No one immediately claimed responsibility for the attack, which also wounded another worshipper while the attacker fled. Local media reported that the mosque’s imam was among those killed.

“I strongly condemn the attack on the Imam Zaman Mosque,” former Afghan President Hamid Karzai said on X. “I consider this terrorist act against all religious and human standards.”

The United Nations Assistance Mission in Afghanistan also condemned the attack, which it said killed and wounded at least seven people, including a child. It called for urgent accountability for perpetrators and protection measures for Shitte communities.

The Islamic State group’s affiliate in Afghanistan is a major Taliban rival and frequently targets schools, hospitals, mosques and Shiite areas throughout the country.

The Taliban seized power in Afghanistan in August 2021, during the last weeks of the chaotic departure of U.S. and NATO troops from the country after 20 years of war.

Despite initial promises of a more moderate stance, the Taliban gradually re-imposed a harsh interpretation of Islamic law, or Shariah, as they did during their previous rule of Afghanistan from 1996 to 2001.