Afghans flee the site of an attack on a Shiite Muslim mosque in Kabul during Friday prayers.

Story highlights

New: At least 20 people killed and 50 injured in attack by bomber, gunmen, official says

Attack happens during Friday prayers at Shiite mosque in Kabul

Kabul, Afghanistan CNN  — 

ISIS is claiming responsibility for an attack Friday on a Shiite Muslim mosque in the Afghan capital of Kabul that authorities said left 20 people dead.

The attack began early Friday afternoon when one of three attackers blew himself up at the gate of the Imam Zaman Mosque as worshippers were attending Friday prayers, according to Interior Ministry spokesman Najib Danish. The remaining attackers stormed the mosque and fired on security forces.

Afghan security officials take positions Friday near the Kabul mosque after the attack.

Authorities killed the gunmen after a nearly four-hour firefight, Danish said.

At least 20 people have died, and 50 others were injured, according to Ismail Kawosi, a spokesman for the Ministry of Public Health. Earlier, officials said two police officers were among the dead.

Afghan security officials are on the scene Friday near the Imam Zaman Mosque in Kabul.

ISIS claimed responsibility, saying in a statement posted by its Amaq News Agency that suicide bombers from the group attacked the mosque.

It’s at least the second time this month that ISIS has claimed responsibility for an attack targeting Shiite worshippers in Afghanistan.

The terror group also said it was behind a dual suicide blast at a mosque in the western city of Herat on August 1. That attack killed more than 30 people as they gathered for evening prayers, according to local officials.

CNN’s Ehsan Popalzai reported from Kabul, while CNN’s James Masters wrote from London. CNN’s Matt Rehbein and Roba Alhenawi contributed to this report.