In a statement released on Friday, the foreign ministry voiced condolences and expressed grief to the Pakistani people and government and wished the injured a speedy recovery.
The statement asserted that Egypt stands by the side of Pakistan in face of terrorism in all its forms.
Also, Egypt's Mufti and President of the General Secretariat for Fatwa Authorities Worldwide Shawki Allam said that terrorist groups do not respect sanctity of blood or mosques.
The mufti extended his deep condolences to the Pakistani government and people over the victims of the terrorist attack, wishing the injured a speedy recovery.
Two armed men on a motorcycle arrived near mosque and opened fire when they were stopped by police, before one of them forced his way into a crowded hall and detonated his suicide vest, reported Reuters citing a senior police official.
The attack has left at least 56 dead and 194 injured, it added.