The explosion targeted the mosque inside Akhun Punjo Baba mazar (shrine) in Akbarpura area of Nowshera, about 15 km from Khyber-Pakhtunkhwa capital Peshawar.
Scores of people were offering Friday prayers at the mosque while hundreds had gathered to take food from a `langar` or community kitchen.
Ten worshippers, including a child, were killed, police said.
At least 30 others were injured and the condition of eight was described by officials as serious.
The injured were taken to hospitals in Nowshera, Pubbi and Peshawar.
Fazal Diyan, a witness, told Geo News channel that the blast occurred just after the prayers ended.
"The blast occurred within the mosque," he said.
He estimated that over 1,000 people were present in the shrine. No group claimed responsibility for the blast.
The explosion was heard from several kilometres away.
Reports said the blast was caused by a remote controlled bomb hidden in a cupboard within the mosque.
Footage on television showed caps and shoes strewn within the mosque. Windows were blown out by the blast, which also caused extensive damage to the walls of the mosque.
Witnesses said many worshippers were hit by shrapnel. They added that there was almost no security at the shrine complex.
The Pakistani Taliban are opposed to the practice of worshipping at Sufi shrines and consider it "un-Islamic".
The Taliban have claimed responsibility for several recent attacks on Sufi shrines in cities across Pakistan, including Lahore and Karachi.
President Asif Ali Zardari and Prime Minister Yousuf Raza Gilani condemned the bomb blast in the mosque.
In a message,Zardari described the attack as an "abhorrent act" and said its perpetrators were the enemies of Islam.
"The government would continue to take a firm stand against extremist and terrorist elements across the country and would not be cowed down by such acts of violence," he said. Nowshera has been targeted by militants in the past too.
On June 12, 2009, at least six persons were killed and over 90 injured when a suicide bomber rammed his explosives-laden truck into a mosque within an army supply depot in the city.