Image copyright EPA Image caption Afghan police outside the al-Zahra mosque in Kabul

So-called Islamic State has said it carried out a deadly attack on a mosque in the Afghan capital Kabul in an area dominated by minority Shia Muslims.

The Sunni extremist group claimed responsibility for the al-Zahra mosque suicide bombing, which left four people dead, through its Amaq news agency.

Among those reportedly killed were a police officer and a prominent local figure who founded the mosque.

The attack comes during the holy month of Ramadan.

It took place at the end of the daily fast. There have been reports that senior officials had been due to attend services at the mosque, on the western edge of the city.

During these particular nights of Ramadan, the Shia hold rituals for martyrdom of Imam Ali, the cousin and son-in-law of the Prophet Muhammad.

According to a statement on interior ministry spokesman Najib Danish's social media profiles, the attacker had attempted to enter the mosque but was barred from reaching the prayer hall.

Instead, he triggered a bomb in the kitchen.

It has also been reported that the sounds of gunfire rang out after the explosion, which also left four police officers and four civilians wounded.

An attack last month in Kabul killed 90 people when a suicide attacker detonated a bomb hidden inside a tanker truck close to the heavily protected diplomatic area during the morning rush hour.

Some 400 people were injured by that blast, which left a deep crater.

No group has said it carried out that attack but Taliban militants denied being involved. Recent bomb attacks in Kabul have been claimed either by the Taliban or so-called Islamic State (IS).

The attack was followed by a series of protests against the deterioration of security, during which five people died when police fired on protesters.

Suicide bombers later targeted the funeral of one of the protesters, killing at least seven people. Another 100 people were injured.

Why are people being attacked during Ramadan?

In recent years, there seems to have been a noticeable spike in violence during Ramadan - despite it being a time for penance and temperance.

But while most Muslims view it as such, Shiraz Maher, of King's College London, explained in an article for the BBC last year that others see it differently.

"For 30 days, Muslims abstain from drink and food during sunlight hours and believe that God is at his most forgiving during this time," he wrote.

"Mosques are consequently fuller than usual, typically packed with worshippers seeking divine mercy and blessings.

"Juxtaposed alongside that ascetic puritanism is the view of radicals who regard Ramadan as a month of conquest and plunder.

"They believe it is an opportune moment to double down on their millenarian war against civilisation and therefore launch more attacks than normal."