The mosque is within a high-security zone and an investigation is under way into how the bomber got in.
The attack, one of Pakistan's bloodiest in years, has left scores more injured.
A Pakistani Taliban claim to have carried out the bombing was later denied by the militant group, which blamed it on a splinter faction.
In the past the Pakistani Taliban have refrained from claiming some attacks on mosques, schools or markets because they say they are at war with security forces and not the Pakistani people, but many doubt such denials.
On Tuesday, rescuers scrambled to retrieve worshippers buried in the rubble, pulling out nine people alive but recovering more of the dead. No-one remained trapped, local officials said.
"Terrorists want to create fear by targeting those who perform the duty of defending Pakistan," said Prime Minister Shehbaz Sharif. He declared a national day of mourning.
The BBC saw ambulances racing in and out of the compound every few minutes.
More than 50 remain wounded, some of them critical.
Meanwhile, funerals have been carried out for more than 20 police officers, their coffins draped with the Pakistan flag. Most of the dead were members of the security forces.
Hundreds packed the funeral of Irfan Ullah, a police inspector killed in the explosion. Only a few days before, he had survived another attack - an ambush where some of his colleagues died.
Armed security guarded the prayers. Some attending cried quietly.
Mr Ullah left behind a wife and five children. At the graveside, his brother Muhammed Zahid described the family's pain.
"When we first heard that there had been a blast, we started to call him," Muhammed told our team. "The phone was ringing out which initially gave us hope. But when we asked the police, they told us that he had been killed. The fourth body I saw was his."
"He was kind-hearted, friendly, ready to help others. He was also brave, he was never afraid of anything. We always used to tell him to be careful, but he used to reply: 'No, it's my duty'. It is a huge loss to our family."
Between 300 and 400 police officers had been in the area at the time, Peshawar police chief Muhammad Ijaz Khan earlier told local media.