Afghan police officers take position during a clash between Afghan forces and insurgents after a suicide attack on a Shiite mosque in Kabul on Aug. 25. (Omar Sobhani/Reuters)

A suicide bomber set off a blast at a Shiite mosque Friday as gunmen opened fire and panicked worshipers leapt from windows in the latest attack claimed by the Islamic State against Shiite sites. At least 30 people were killed during a siege that lasted nearly five hours, security sources said.

Scores of worshipers, including women and children, were inside the mosque in Kabul when at least four assailants wearing police uniforms stormed the compound and later battled security forces that surrounded the site.

Interior Ministry spokesman Najib Danesh had said earlier in the day that 10 worshipers and two policemen were killed and that at least 30 people were wounded, including women and children.

Security sources later put the overall toll at 30 people killed and “dozens” wounded, the Reuters news agency reported.

Officials from security services and the Public Health Ministry warned that the casualty count could go higher. The Associated Press, citing hospital officials, said the death toll was at least 20.

A member of Afghanistan’s Shiite clerical council, Mir Hussain Nasiri, said the mosque’s imam was among those killed.

A statement carried by the Islamic State-linked Amaq News Agency said the militant group’s Afghanistan-based wing claimed responsibility for the attack. But the Islamic State often quickly asserts responsibility for attacks, and the claim could not be independently verified.

[Taliban violence creeps into new areas of Afghanistan]

Danesh said special police units were dispatched to the area. Security forces exchanged fire with the assailants, and the sound of an explosion was heard nearly two hours after the attack began.

The attack is the latest in a spate of strikes against Shiites in Afghanistan, where both the Taliban and Islamic State affiliates are fighting against the government and foreign troops. Sunni extremists view Shiite Islam as a heretical branch of the religion.

The Islamic State has asserted responsibility for all of the targeted attacks against Shiites. In one such attack a few weeks ago, more than 30 worshipers were killed when assailants stormed a Shiite mosque in Herat province.

The Islamic State’s Afghanistan faction consists of some disaffected Taliban members, and it has been behind attacks that have claimed the lives of several U.S. troops in recent weeks.

President Trump this week announced a revamped strategy for Afghanistan that includes possibly boosting U.S. troop levels.

Bashir Bezhen, a security analyst, said the latest mosque attack was part of an effort to widen sectarian rifts.

“These attacks are quite worrying,” he said, “and the aim is to start a conflict this time between the Shiites and Sunnis.”

Read more:

Today’s coverage from Post correspondents around the world

Like Washington Post World on Facebook and stay updated on foreign news