The explosion occurred on Thursday in the northern Afghan city of Mazar-i-Sharif and ISIS claimed responsibility, Reuters reported.
Balkh province police spokesman Asif Waziri said the man, Abdul Hamid Sangaryar, was a key operative of ISIS.
“He was the mastermind of yesterday's attack on the mosque,” Mr Waziri told AFP.
The Interior Ministry also reported the arrest of Mr Sangaryar, an Afghan citizen.
“He played a key role in several attacks in the past and had repeatedly managed to escape, but this time we arrested him in a special operation,” Mr Waziri said.
Earlier this week, at least six people, including children, were killed in a terrorist attack at a boys school in Kabul. A separate hand grenade attack on an education centre nearby caused further casualties. At least 24 people were wounded in the attacks.
The Taliban have regularly raided suspected ISIS hideouts, especially in eastern Nangarhar province, considered to be a stronghold of ISIS-K, the local wing of the militant group.
The group has taken responsibility for deadly attacks in Afghanistan, often against Shiite targets, even as the number of bombings has fallen since the Taliban seized power in August last year.
Shiite Afghans are mostly from the ethnic Hazara community and make up between 10 per cent and 20 per cent of the country's 38 million people. They have long been the target of ISIS extremists, who consider them to be heretics.
Taliban fighters have also been attacked.
However, the growing number of bombings in Hazara districts could heighten fears that minorities will not be protected by the Taliban.
Agencies contributed to this report