At least 54 people were killed, and 83 injured, in the attack, which occurred in Bajaur district in Khyber Pakhtunkhwa province.
International media reported on Monday that the Islamic State has claimed responsibility.
Speaking that day in New York, Deputy UN Spokesperson Farhan Haq said the Secretary-General extends his heartfelt condolences to the families of the victims and wishes a prompt recovery to the wounded.
The UN chief also called on the Pakistani authorities to bring those responsible to justice.
“The Secretary-General denounces all instances of terrorism and deliberate targeted attacks against civilians and stands in solidarity with the government and the people of Pakistan in combating this scourge,” he said.
The UN Office in Pakistan has also strongly condemned the attack In a post on Twitter, adding “we express our deepest condolences to the families of the victims and wish the injured a quick recovery.”