KABUL -- A bomb exploded Friday inside a mosque in western Kabul, killing at least four people, including the prayer leader, and wounding eight, an Afghan government official said.

Interior Ministry spokesman Tariq Arian said the bomb had been placed inside the mosque but had no additional details. Police cordoned off the area and helped move the wounded to ambulances and nearby hospitals.

No one took immediate responsibility but a mosque attack earlier this month was claimed by the Islamic State group's affiliate. The Taliban issued a statement condemning the attack and calling the death of the prayer leader a "great crime."

Azizullah Mofleh Frotan was among the city's more prominent prayer leaders.

Violence has spiked in recent weeks in Afghanistan, with most of the attacks claimed by the ISIS affiliate, headquartered in the eastern Nangarhar province. Earlier this month, ISIS planted explosives at a mosque in Kabul's posh Wazir Akbar Khan neighbourhood, killing the prayer leader there and wounding eight others.

The United States blamed the ISIS affiliate for a horrific attack last month on a maternity hospital in Kabul that killed 24 people, including two infants and several new mothers. The hospital was located in the city's Shiite-dominated area of Dasht-e-Barchi.

The ISIS group, which reviles Shiites as heretics, has declared war on the country's minority Shiite Muslims, but has also attacked Sunni mosques. The mosque targeted on Friday is Sunni.

The ISIS affiliate also took responsibility for an attack on a bus carrying journalists in Kabul on May 30, killing two. It also claimed credit for an attack on the funeral of a warlord loyal to the government last month that killed 35 people.

Washington's peace envoy Zalmay Khalilzad was in the region earlier this week, trying to resuscitate a U.S. peace deal with the Taliban, who are expected to eventually be enlisted in the fight against the IS affiliate.

The peace deal signed in February to allow U.S. and NATO troops to leave Afghanistan includes a commitment by the Taliban to fight other militant groups and a vow that Afghanistan's territory would not be used to attack the United States or its allies.

Washington has previously said that the Taliban have been instrumental -- along with Afghanistan's National Security and Defence Forces and U.S. air strikes -- in reducing the ISIS's strength in eastern Afghanistan.

------

Associated Press writer Kathy Gannon in Islamabad contributed to this report.