A volley of gunfire rang out in Kabul on Friday at a ceremony attended by top Afghan government officials.

Former President Hamid Karzai, Chief Executive Abdullah Abdullah and a number of other figures fled the site in the capital Kabul, a spokesman of the chief executive told Anadolu Agency.

Abdullah escaped unhurt, spokesman Omaid Maisam said.

At least 18 people got injured in the firing incident that took place at 11.20 a.m. local time (0650GMT), said Nusrat Rahimi, an Interior Ministry spokesman.

"Special units of police reached the spot, all high officials and figures moved from the area safely," he said in a statement. 

A number of top Afghan government officials and politicians were forced to flee the scene following gun fires, an official confirmed.

The Taliban quickly rejected any involvement. The group's spokesman Zabihullah Mujahid tweeted that the Taliban were not involved in the attack.

Afghan President Mohammed Ashraf Ghani called it an “inhumane attack against national unity”.

The leader inquired about the wellbeing of his bitter electoral rival Abdullah during a phone conversation.

It came after the US and Taliban reached a landmark peace deal aimed at ending violence in the war-torn country.

The gathering was held to mark the death anniversary of Shia leader Abdul Ali Mazari.

In 2019, a ceremony marking the death anniversary of Mazari -- the slain leader of the country's Shia Hazara community allegedly killed by the Taliban in 1995 -- was also attacked in similar fashion, leaving 11 people killed. Daesh claimed that attack.