Security was increased around sites hit by attackers
A series of gun and bomb attacks on security forces in Pakistan has killed about 40 people.
In Lahore, police and militants fought gun battles at a federal security building and two police academies that left at least 26 people dead.
A suicide car bomb at a police station in the north-western town of Kohat left 11 dead, while another car bomb in the nearby city of Peshawar killed a child.
More than 150 have died in Pakistan in militant attacks in the past two weeks.
AT THE SCENE
Orla Guerin, BBC News, Lahore
At a hospital, a constable injured in the attack at Manawan police academy told us he was on a break when the gunfire started.
He didn't know he had been hit until he took cover behind a wall.
Despite his injured arm, he says he'll continue to serve his country. He wouldn't say if the government should pursue the Taliban.
People in Lahore have told us everyone is scared.
These strikes seem to say to security forces "the more you come after us, the more we'll go after you".
Later, US President Barack Obama signed into law a $7.5bn (£4.6bn) civilian aid package for Pakistan.
Thursday's attacks come ahead of an expected military offensive against the Pakistani Taliban in their South Waziristan stronghold on the Afghan border.
The worst of the violence was in Lahore, Pakistan's second-largest city.
Ten gunmen, some of them teenagers, died in attacks on three police centres in the Punjab province capital.
Seven people - including police and attackers - were killed as gunmen stormed the FIA building in Lahore.
An FIA building nearby was targeted in a deadly suicide attack in March last year.
At Lahore's Manawan police training academy, three attackers are said to have blown themselves up. Eight other people died.
The same academy was targeted in a deadly attack in March this year.
A third team scaled a wall at a police commando training centre near the airport at Bedian and reportedly began shooting and tossing grenades.
Police say the situation is now under control at all three facilities.
The government has reacted by transferring responsibility for security in the capital Islamabad from the police to a paramilitary force, the Rangers.
"They were not here to live. They were here to die," Sajjad Bhutta, a senior government official, told AP news agency. "Each time they were injured, they blew themselves up.
"They were well trained to the extent they could jump over the walls and shoot well."
In Kohat, a suicide bomber rammed his car into the wall of the police station compound.
The Peshawar car bomb went off outside a housing complex for government employees, reportedly killing a six-year-old boy.
Finger of blame
Interior Minister Rehman Malik said: "The enemy has started a guerrilla war," reports AP.
"The whole nation should be united against these handful of terrorists, and God willing we will defeat them."
The BBC's Aleem Maqbool in Islamabad says that although no group has yet claimed responsibility for the attacks the finger of blame will point towards the Taliban.
Separately, a US drone aircraft fired two missiles at a house in North Waziristan, killing five Taliban militants, Pakistani officials said.
Nuclear-armed Pakistan is under US pressure to flush out militants as President Obama considers sending more troops to neighbouring Afghanistan.
Lahore, the centre of Pakistan's cultural life, was long spared the brunt of unrest, but has seen a string of deadly attacks throughout 2009.
In one of the most notable incidents, in March, gunmen attacked the visiting Sri Lankan cricket team, killing six policemen.
OTHER RECENT MILITANT ATTACKS IN PAKISTAN
12 October - Security convoy attacked in Swat valley, 41 die
10 October - Militants attack Rawalpindi army HQ - 20 killed
9 Oct - At least 50 die in Peshawar suicide blast
5 Oct - Five killed in suicide bomb at UN Islamabad offices
26 Sept - 16 die in suicide car bombs in Peshawar and Bannu