"This joint cell of Daesh and Haqqani network had carried out major attacks in the capital, including an attack on a Sikh temple in March," the NDS said, using the Arabic acronym for IS.
At least 25 people were killed when gunmen stormed the temple in Kabul where worshippers were offering morning prayers.
The attack was claimed by the Islamic State in the Khorasan (IS-K), the Afghan branch of IS.
The IS-Haqqani cell was also behind a rocket attack that targeted the swearing-in ceremony of Afghan President Ashraf Ghani, the intelligence agency said.
The members of the cell had also killed several Afghan officials and fired rockets at Bagram, the US military's largest base in Afghanistan, the NDS said.
Afghan officials have long accused the Haqqani network, a US-designated terror group with ties to the Taliban, of carrying out major attacks claimed by or blamed on IS-K.