The mosque is within the tightly-guarded police headquarters area.
Prime Minister Shehbaz Sharif said "terrorists want to create fear by targeting those who perform the duty of defending Pakistan".
No group has said it carried out the attack, but it has been linked to the Pakistan Taliban.
The group ended a ceasefire in November, and violence has been on the rise since.
In December it targeted a police station - like Peshawar, in the north-west of the country - leading to the deaths of 33 militants.
Early unconfirmed reports said a bomber had blown himself up in the mosque on Monday.
A hospital spokesman told the BBC the death toll stands at 59, while 157 people were injured.
Peshawar police chief Muhammad Ijaz Khan told local media that between 300 and 400 police officials were in the area at the time.
The mosque is in one of the most tightly controlled areas of the city, which includes police headquarters and intelligence and counter-terrorism bureaus.
In a statement, PM Sharif said those behind the attack "have nothing to do with Islam". He added: "The entire nation is standing united against the menace of terrorism."
The blast took place around 13:30 (08:30 GMT) during afternoon prayers in the north-western city, near the country's border with Afghanistan.
A video circulating on social media and verified by the BBC showed that half of a wall caved in. The mosque was covered in bricks and debris as people clambered over the rubble to escape.
A rescue operation is continuing inside the mosque and "more bodies are being taken out," Peshawar city Deputy Commissioner Shafiullah Khan said.
"Currently our priority is to save people buried under the debris," Mr Khan added.