The attackers appeared to be in a building behind the Eidgah Mosque in a central district of Kabul.
It said security personnel killed two of the insurgents, and that clashes were "ongoing".
An MD 530F military helicopter targets a house where attackers are hiding in Kabul, Afghanistan, Tuesday, Aug. 21, 2018.
"Police have cordoned off the area", he said.
The Taliban on Monday appeared set to reject the Afghan government's offer of another holiday truce and took almost 200 passengers hostage when they ambushed three buses travelling to the capital.
Ghani heard the thud and interrupted his message to say: "If they are thinking the rocket attack will keep Afghans down, they are wrong".
Militants have fired mortars at the diplomatic quarter of the Afghan capital Kabul during a speech by the president to mark a Muslim holiday.
Two people were wounded, AFP reported citing an interior ministry spokesman.
"Our leadership feels that they'll prolong their stay in Afghanistan if we announced a ceasefire now", one leader said.
President Ghani instructed the national defense and security forces to continue to their operations against the Taliban until a positive response has not been received.
Kabul police spokesperson Hashmat Stanikzai said police believe at least four militants are involved in the assault.
Ghani unveiled the government's latest ceasefire gambit during an Independence Day address late Sunday, saying security forces would observe the truce beginning this week - but only if the militants reciprocated.
The truce offer was welcomed by the United States and North Atlantic Treaty Organisation after almost 17 years of war, though it was not clear if their forces in Afghanistan would also participate.