A suicide bomber blew himself up inside a Shia mosque in Kabul on August 25, 2017 in what officials said was an ongoing attack, the latest violence to strike the Afghan capital.

Kabul Police spokesman Abdul Basir Mujahid told AFP a suicide bomber “detonated himself inside the mosque”, adding that there were casualties but he could not confirm how many.

The Interior Ministry confirmed a “terrorist attack” had taken place while residents told AFP they could hear gunshots.

The attack occurred at a time when many Muslims would be attending Friday prayers, and raises fears of sectarian violence in the capital.

It also comes days after U.S. President Donald Trump cleared the way for thousands more American troops to be deployed in the war-torn country.

Najib Danish, a deputy spokesman for the Interior Ministry, told TOLOnews that initial information suggested a suicide bomber detonated himself, while two or three other militants had entered the mosque and were exchanging fire with police.

“The bombers are running short of bullet rounds and they are using knives to stab worshippers,” an eyewitness told AFP.

The assault underscores spiralling insecurity in Afghanistan as a resurgent Taliban steps up offensives across the country, while the Sunni Islamic State group, known for carrying out sectarian attacks, expands its Afghan footprint.

Last month dozens of people were killed and scores wounded after a Taliban-claimed car bomb struck a bus carrying government employees through a Shia neighbourhood in the capital.