The National Directorate of Security (NDS) said the detained individuals have been identified as Ehsanullah son of Karimullah and Omaar son of Abdul Hadi.
A statement by NDS said the Ehsanullah is a senior member of the military commission of the ISIS terrorist group while Omar was a member of the recruitment commission of the terror group.
The statement further added that the detained individuals have confessed that they had planned and executed the deadly attack on Imam Zaman mosque in Kabul city.
According to NDS, the detained individuals have also confessed that they were involved in various other terrorist related incidents.
The anti-government armed militant and terrorist groups including the ISIS insurgents have not commented regarding the report so far.
The attack on Imam Zaman mosque was carried out late in the month of October last year claiming at least 50 lives, with 50 more persons injured.