wld_abdullah afghan-1583482741298
Afghanistan's Chief Executive Abdullah Abdullah speaks during a live debate on Tolo TV channel in Kabul on Thursday. The Afghan leader escaped an attack at a gathering in Kabul on Friday. Image Credit: Reuters

Kabul: Gunmen killed at least 27 people and wounded 29 more in Afghanistan's capital on Friday at a remembrance ceremony for a Shiite leader, officials said.

Health Ministry spokesman Wahidullah Mayar said the victims were taken to local hospitals.

Several prominent political leaders escaped the ceremony unhurt, including Abdullah Abdullah, the country's chief executive and a top contender in last year's presidential election.

Foreign security personnel and Afghan police arrive at the site of an attack in Kabul on Friday. Image Credit: AP

Afghan security forces were still trying to flush the gunmen out of a half-finished apartment building, Interior Ministry spokesman Nasrat Rahimi said.

This is the first big attack on the capital since a troop withdrawal agreement was signed in Doha between the United States and the Taliban.

The Taliban said in a statement they were not involved in the attack.

"The attack started with a boom, apparently a rocket landed in the area, Abdullah and some other politicians ... escaped the attack unhurt," Abdullah's spokesman, Fraidoon Kwazoon, who was also present, told Reuters by telephone.

Broadcaster Tolo News showed live footage of people running for cover as gunfire was heard.

Rahimi said special police forces had been sent to the area.

Afghan president Ashraf Gani condemned the attack, calling it a “crime against humanity.”

The gathering was marking the anniversary of the death of Abdul Ali Mazari, an ethnic Hazara leader who was killed in 1995 after being taken prisoner by the militants.

Several people were killed in a similar attack on the same commemoration last year. Daesh militants claimed responsibility for that attack.