Officials and locals said the death death could climb further since the school building, in which the poll was being held, collapsed after the blast.
"There are still people under the rubble. Villagers are trying to retrieve the trapped people," Kashif Khan, a witness, said.
"We don't know how many people are dead and how many alive."
The school is in the town of Buner, in the North West Frontier Province. Security forces are attempting to subdue al-Qaeda and Taliban fighters in the area.
It was unclear whether the bomb was triggered by remote control or a suicide attacker.
A spokesman for anti-government fighters operating in the restive Swat valley, which shares boundaries with Buner, claimed responsibility for the bombing.
The attack was to avenge the killing of six of their comrades by a pro-government militia in Shal Bande on August 13.