"It may rise," said Bahramand Khan, director of information for the Chief Minister's Secretariat. He said more than 100 of the dead were school children.
"Many are in the operation theatre now in critical condition, undergoing treatment," said hospital official Ejaz Khan.
A Reuters journalist at the scene heard heavy gunfire from inside the school as soldiers surrounded it. Helicopters hovered overhead and ambulances ferried wounded children to hospital.
The Pakistani Taliban, who are fighting to topple the government and set up a strict Islamic state, have vowed to step up attacks against Pakistani targets in response to a major army operation against the insurgents in the tribal areas.
The army said in a statement that many hostages had been evacuated but did not say how many.
"Rescue operation by troops underway. Exchange of fire continues. Bulk of student(s) and staff evacuated. Reports of some children and teachers killed by terrorist," the army said in a brief English-language statement.
Military officials at the scene said at least six armed men had entered the military-run Army Public School. About 500 students and teachers were believed to be inside.
"We were standing outside the school and firing suddenly started and there was chaos everywhere and the screams of children and teachers," said Jamshed Khan, a school bus driver.
One student inside the school at the time of the attack told a private television channel: "We were in the examination hall when all of sudden firing started and our teachers told us to silently lay on the floor. We remained on the floor for an hour. There was a lot of gunfire.
"When the gunfire died down our soldiers came and guided us out."
Taliban spokesman Muhammad Umar Khorasani told Reuters his group was responsible for the attack.
"Our suicide bombers have entered the school, they have instructions not to harm the children, but to target the army personnel," he said.
"It's a revenge attack for the army offensive in North Waziristan," he said, referring to the anti-Taliban military offensive that began in June.