The Sunni Islamic State group (IS) claimed responsibility for the gruesome assault on the pro-Iranian Tabayan cultural centre, the third deadly attack it has claimed in the Afghan capital this month.
Up to 100 people had gathered at the centre to mark the 38th anniversary of the Soviet invasion of Afghanistan. It is located in western Kabul, in the same building as affiliated Afghan Voice Agency (AVA), an anti-IS media outlet.
"The latest figures we have from this tragic incident shows 41 people have been killed and a further 84 people injured," health ministry spokesman Waheed Majroh told reporters.
Kabul has become one of the deadliest places in war-torn Afghanistan for civilians in recent months, as the Taliban step up their attacks and IS seeks to expand its presence in the country.
Thursday's attack saw chaotic scenes at the Istiqlal hospital where ambulances and police pickups brought victims, including women and children.
Many of them had suffered severe burns to their faces and bodies, as well as shrapnel wounds, AFP reporters said.
Visibly distressed relatives searching for their loved ones inside the medical facility slapped their heads in fury as they cried and cursed the government for seemingly being unable to end the regular carnage on their streets.
Some were so distraught they crawled on the ground pulling their hair.
AFP reporters saw more than a dozen badly burned bodies lying on the floor in a room inside the hospital and wooden coffins being delivered so families could take away the remains of loved ones.
Deputy interior ministry spokesman Nasrat Rahimi told AFP the attack -- the deadliest since a Shiite mosque bombing in October that killed more than 50 worshippers -- was followed by two smaller bomb blasts as victims and survivors were leaving the scene.
A journalist with AVA, which is located above the cultural centre, said that more than a hundred people were at the event in the building's basement, with a number of AVA staff among the victims.
Thursday's assault comes days after a suicide bomber killed six civilians in a Christmas Day attack near an Afghan intelligence agency compound in the city, which was also claimed by IS.
On December 18 militants from the group stormed an intelligence training compound in Kabul, triggering an intense gunfight with police, two of whom were wounded.
The Middle Eastern jihadist outfit has gained ground in Afghanistan since it first appeared in the region in 2015, and has scaled up its attacks in Kabul, including on security installations and the country's Shiite minority.
A man attending the anniversary ceremony at Tabayan said he heard a "big boom".
"When the explosion happened we immediately fled," he told Tolo News.
Mohammad Hasan Rezayee, a university student who was also at the ceremony, told Tolo News he had suffered burns to his face in the blast.
"We were inside the hall in the second row when there was an explosion behind us. I did not see the bomber," he said from his hospital bed.
"After the blast, there was fire and smoke inside the building and everyone was pleading for help."
The attack drew international condemnation, with NATO's Resolute Support mission in Afghanistan describing it as "heinous". Amnesty International said it was further evidence that Kabul was not safe.
"The European governments who insist on this dangerous fiction by forcibly returning Afghans are putting their lives in danger," Amnesty International's South Asia director Biraj Patnaik said in a statement.
Germany, which has expelled dozens of Afghans in recent months, said "we cry" with the victims of the attack, according to a statement from Foreign Minister Sigmar Gabriel.
Interior ministry spokesman Najib Danish vowed to "avenge the blood" of the victims, many of whom were students.
Authorities would also investigate "possible negligence by police personnel", Danish told reporters.
Security in Kabul has been ramped up since May 31 when a massive truck bomb ripped through the diplomatic quarter, killing some 150 people and wounding around 400 others -- mostly civilians. No group has yet claimed that attack.
Religious attacks in Afghanistan have skyrocketed in the past two years with the minority Shiite community the main target, the United Nations said in November.
IS, a Sunni extremist group, has claimed most of the attacks on Shiite worshippers as it seeks to stir up sectarian violence in the country.
The Afghan media has also previously been targeted by militants, underlining the risks faced by journalists in the war-torn country. (AFP)