Nearly 100 people were wounded in eight hours of fighting
Pakistan's interior minister has urged the country to unite against insurgents after gunmen launched a deadly attack on a police academy in Lahore.
Rehman Malik said the country had a choice between letting the Taleban take over and uniting to fight them.
He also pointed the finger at other extremist groups, while suggesting that a foreign state may have been involved.
But later the chief of the Pakistani Taleban told Reuters news agency his group was behind the attack.
"Yes, we have carried out this attack. I will give details later," Baitullah Mehsud, who is based in the lawless Waziristan tribal region, told Reuters by telephone.
Security officials are interrogating at least four suspects captured after the attack, police say.
Two civilians, eight policemen and eight militants were killed, and 95 people injured, during the eight-hour battle to wrest back control of the academy, according to the interior ministry.
Until this year, the city, Pakistan's cultural capital, had remained relatively free of post-9/11 militant violence.
But Pakistan's militants appear to be running riot, the BBC's Damian Grammaticas reports from Lahore.
Mr Malik said Pakistan's integrity was "in danger at this time".
Jill McGivering reports from outside the academy near Lahore
This was a well-organised attack that will raise concern about the sophistication of the group behind it.
Pakistan is facing a broad insurgency from groups linked to al-Qaeda, the Afghan Taleban and the Pakistani Taleban, as well as from religious extremists and criminals taking advantage of the situation.
It is unclear who was responsible for this attack, but its co-ordinated nature could point to one of the more international groups.
He told reporters in Lahore that the militants were believed to be fighters loyal to Mehsud.
"The entire planning was done there," he said.
One of the attackers, he said, was an Afghan national.
The minister also suggested that a foreign country was interfering in Pakistan's domestic affairs.
"Some rival country, or some hostile [intelligence] agency is definitely out to destabilise our democratic forces," he said, in a possible reference to Pakistan's long-time foe, India.
Indian officials have condemned the attack on Lahore.
Mr Malik also told state-run TV that Pakistan's police were not equipped to fight the wave of militancy.
"In our country, at our different borders, arms are coming in, stinger missiles are coming in, rocket launchers are coming in, heavy equipment is coming - it should be stopped," he said.
"Whoever the anti-state elements are, they are destabilising the country."
Scene of carnage
Gunmen seized the Manawan police training school on the outskirts of Lahore during a morning drill on Monday.
MAJOR PAKISTAN ATTACKS
27 March 09: Suicide bomber demolishes crowded mosque near the north-western town of Jamrud, killing dozens
3 March 09: Six policemen and a driver killed, and several cricketers injured, in ambush on the Sri Lanka cricket team in central Lahore
20 Sept 08: 54 die in an attack on the Marriott hotel in Islamabad
6 Sept 08: Suicide car bombing kills 35 and wounds 80 at a police checkpoint in Peshawar
Aug 08: Twin suicide bombings at gates of a weapons factory in town of Wah leave 67 dead
March 08: Suicide bombs hit police headquarters and suburban house in Lahore, killing 24
Security forces used helicopter gunships against the compound as troops entered to confront the grenade-throwing militants.
Some of the militants are believed to have blown themselves up with suicide vests.
Our correspondent, who witnessed the aftermath, saw broken glass, bullet casings and pieces of human flesh scattered over the floor of the academy.
The attack came days after US President Barack Obama pledged to put Pakistan, along with Afghanistan, at the heart of his fight against al-Qaeda militants.
He said "al-Qaeda and its extremist allies" were "a cancer that risks killing Pakistan from within".
US officials have pledged to help Pakistan target so-called "safe havens" for militants in Pakistan's north-west tribal region bordering Afghanistan.