Ban said the attack was "unjustifiable" and called it a "heinous crime."
He spoke to reporters in Geneva on Monday after a suicide bomber disguised as a security officer struck the lobby of the building in Islamabad.
The world body said it was closing its offices in Pakistan temporarily.
Ban also sent his deepest condolences to the victims and their families.
Militants have carried out scores of suicide attacks in Pakistan over the past 2 1/2 years, several of them targeting foreigners and their interests.