In a statement on Friday evening, Baqaei expressed condolences to the families of those killed as well as the government and people of neighboring Pakistan.
He underscored Iran’s principled position in firmly condemning all forms of terrorism and violent extremism, saying terrorist and violent acts against civilians and security personnel have absolutely no justification.
The official also called for stronger regional cooperation against terrorism.
At least 21 people, including five civilians and 16 police officers, were killed and more than 70 others injured in a suicide attack targeting a police compound in northwestern Pakistan during Friday prayers.
Police said six terrorists, including a suicide bomber, were also killed in the attack.