Rockets could be heard exploding nearby during prayers in Afghanistan to mark the start of the Muslim holiday of Eid al-Adha.
Worship at the presidential palace in Kabul continued despite the attack, with some appearing frightened and unsure of what to do.
The prayers were broadcast live and President Ashraf Ghani was present.
The attack came amid rising violence in the country, as foreign troops withdrew after 20 years.
Read more: Life in Afghanistan after leaving the United States