"I would like to express my deepest condolences for the victims and their families and friends," the UN secretary general said at a press conference during a visit to The Hague.
"I condemn strongly these terrorist attacks," he said, adding "there's no justification whatsoever (for) attacking civilian people as well as security people."
The Taliban claimed responsibility for the attack in a densely crowded Kabul neighbourhood, which came a week after the insurgents launched their annual spring offensive.
Ban was in the Dutch city to take part in a ceremony to mark the official opening of the International Criminal Court later Tuesday, as well as celebrations for the 70th anniversary of the International Court of Justice.