Gunfire broke out at a commemoration ceremony in Kabul, in what appeared to be the first attack to hit the Afghan capital since the US signed a withdrawal deal with the Taliban.
The Ministry of Public Health confirmed to The National that at least 27 people were killed and 29 others injured, with the number expected to rise.
The event was attended by senior Afghan leaders who escaped unharmed, they include Chief Executive Abdullah Abdullah, former president Hamid Karzai and the head of the country's High Peace Council on Friday.
"Afghan special forces and police forces have reached the site," said Nasrat Rahimi, an interior ministry spokesman.
A spokesman for Afghanistan's Taliban insurgents said the group was not behind the attack.
The shooting came from an under-construction building near the site of the ceremony in Kabul's Dasht-e-Barchi district as council leader Mohammed Khalili was addressing the gathering, according to the Tolo news agency.
"The attack started with a boom, apparently a rocket landed in the area, Abdullah and some other politicians ... escaped the attack unhurt," Mr Abdullah's spokesman, Fraidoon Kwazoon, who was also present, told Reuters.
Ishaq Anees, a resident of the area, described the scene to The National as the attack unfolded.
"A few attackers are holed up in a building next to the venue of the rally and shooting from inside. The Afghan forces are retaliating. They are not sure how many attackers are there, but one of them told me that they suspect about five or six insurgents based on the fire they are receiving," Mr Anees said.
"The situation is tense and people in the neighbourhood are very concerned."
The rally to mark the death anniversary of Abdul Ali Mazari, a leader of the mostly Shiite Hazara community, was attacked last year as well, with ISIS claiming responsibility. One person was killed and several injured when two blasts struck the gathering in 2019.
Mazari was killed in 1995 after being taken prisoner by the Taliban.
The attack this year comes at a delicate time for Afghanistan, with the Taliban and the United States in the initial stages of implementing a peace deal and political tensions running high as Mr Abdullah threatens to challenge the declaration of incumbent Ashraf Ghani as winner of presidential elections held last September.