KABUL, Afghanistan -- A suicide bomber blew himself up outside a mosque in the Afghan capital on Friday, killing five people and wounding 33 others, authorities said, in the latest attack to target the country's minority Shiites.

Mohammad Salim Rasuli, chief of Kabul hospitals, confirmed the fatalities from the attack, which came as worshippers were leaving the Hussainia Mosque in central Kabul following Friday prayers. Police officer Abdul Rahman said the attacker blew himself up on the street about 1,000 yards from the mosque.

Police official Sadiq Muradi said police confronted the attacker as he came through a checkpoint near the holy site, calling for him to stop. But that's when he ignited his explosives, blowing himself up.

Mir Hussain Nasiri, a member of Kabul's Shiite clerics council, told The Associated Press the attacker was disguised as a sheepherder.

Get Breaking News Delivered to Your Inbox

Mohammad Ismail, police chief of Kabul's 10th district, said a second person suspected of involvement was in custody.

Afghan President Mohammad Ashraf Ghani condemned the attack in a statement, saying the "terrorists" targeted civilians and their holy place, which shows the attackers "are against humanity and anti-religion and faith."

The Islamic State of Iraq and Syria (ISIS) affiliate in Afghanistan claimed responsibility for the attack, which took place two days before the Muslim holy day of Ashura. Afghanistan has faced a series of large-scale attacks in recent months targeting minority Shiites for which the Sunni-dominated ISIS has taken responsibility.

In July, ISIS attacked the Iraqi Embassy in Kabul and then warned Shiites in Afghanistan that their mosques would be targeted. Sunni extremists consider Shiites to be heretics.

Within days of that, ISIS also took responsibility for a suicide attack on a Shiite mosque in western Herat province that left 32 people dead.

Last month, militants stormed a packed Shiite mosque in Kabul during Friday prayers in an attack that lasted for hours and ended with at least 20 worshippers killed and another 50 seriously wounded, many of them children. ISIS claimed it was responsible.

The Taliban issued a statement denying any involvement in the attack on Friday, but an Afghan official said a separate attack by the Taliban on a police checkpoint left five police dead in western Farah province.

On Wednesday, U.S. Secretary of Defense James Mattis said during his first trip to Afghanistan since President Trump announced a new strategy for the 16-year-old war there that the United States was committed to see out the conflict to the end, telling his counterparts, "We are here to support Afghanistan."

"We are not quitting this fight. In short, uncertainty has been replaced by certainty," Mattis said shortly after arriving in Kabul Wednesday. Mr. Trump's new policy includes sending in more than 3,000 additional U.S. troops into Afghanistan.