CNN  — 

An explosion ripped through a crowd outside the entrance of a mosque in central Kabul on Sunday, leaving a number of people dead, a senior Taliban spokesman said.

The blast targeted the gates of the Eidgah Mosque in the Afghan capital, where a funeral service was being held for the mother of Taliban spokesman Zabihullah Muhajid, who tweeted that the blast had claimed the lives of civilians.

It was not immediately clear how many people were killed or injured in the attack, but the explosion appeared to be targeting senior Taliban leadership.

Reports on social media described a large detonation and emergency services rushing to the scene. Emergency NGO, an Italian nonprofit that runs a hospital in Kabul, said on Twitter that it was treating four people wounded in the explosion.

The Taliban have not yet announced officially whom they blame for the attack. However, the Islamic State affiliate IS Khorasan (ISIS-K) on Monday claimed responsibility for the blast, saying in a Telegram post that one of their fighters “managed to penetrate a security barrier which surrounds a Taliban funeral council and detonate his explosive belt.”

Amaq News — the Islamic State’s news agency — also said the incident “coincided with a series of bombings and other attacks” carried out by ISIS during “the past days.”

CNN cannot independently confirm the claim.

In what appeared to be a Taliban operation against ISIS later on Sunday night, Kabul was rocked by more explosions and sustained gunfire. Images from the scene posted by local media showed at least two sizeable blasts outside an apartment block.

Taliban spokesman Mujahid said the operation “completely destroyed” an ISIS cell.

“Last night, a special unit of the Mujahideen of the Islamic Emirate carried out an operation against ISIS insurgents in Kabul’s Police District 17. As a result of this operation, which was very decisive and successful, the ISIS center was completely destroyed and all the ISIS members in it were killed,” Mujahid said on Twitter.

A little more than a month since insurgents seized control of Afghanistan, taking control of major cities and installing themselves in the presidential palace in Kabul, the Taliban’s new interim government is facing a range of threats from internal enemies.

A deadly suicide attack at Kabul’s airport in August and a spate of bombings targeting members of the Taliban in the eastern Afghan city of Jalalabad, all claimed by the group IS Khorasan (ISIS-K), an affiliate of ISIS, have highlighted the threat that other violent militant groups pose to the country’s stability and the Taliban’s rule.

In recent days, the Taliban have conducted several operations targeting ISIS-K militants. The group claimed to have killed at least nine ISIS-K members and detained five others in two operations on Friday, targeting ISIS hideouts in the central Afghanistan province of Parwan, according to local Taliban police chief Maulvi Abdul Qadir Haqqani.  

Parwan province neighbors Kabul province, with the capital’s Police District 17 – where Sunday’s operation took place – bordering Parwan.

Eyewitnesses told a local journalist that women and children were killed in the operation in Parwan, a claim confirmed by local police chief Haqqani.

CNN’s Nic Robertson and Celine Alkhaldi contributed reporting.