Foreign Ministry spokesman Saeed Khatibzadeh said the Islamic Republic deplores any act of terror against ordinary people.
He Offered sympathies to the families of the victims and prayed to God for the swift recovery of the injured.
The attack involved two explosions and a raid by gunmen.
Afghan authorities say so far more than two dozen people are confirmed dead in the attack on the 400-bed hospital of Kabul. Some 50 others have been injured. The Taliban say four armed men carried out the terrorist attack.
There is no claim of responsibility. But Daesh terrorists have frequently carried out similar attacks in Kabul and other parts of Afghanistan since the Taliban takeover of the country in summer.