Gunmen have shot dead nine Pakistani police, and wounded eight others after storming a building in the eastern city of Lahore where they were sleeping, police said.
Thursday's raid was the second attack in three days on security personnel in the province of Punjab, raising fears of a fresh wave of violence in the political heartland of Pakistan away from the northwest, the base for armed Taliban fighters.
The attackers arrived on motorbikes and targeted a building in the densely populated area of Ichra, where up to 35 police and prison staff were living, mostly officers from the troubled northwest who were in Lahore for training.
"The gunmen came early in the morning, entered the building and opened fire," Lahore police chief Aslam Tareen told the AFP news agency.
The attackers stormed the compound, housing police officers undergoing further training as prison guards, with assault rifles and grenades.
Shafqat Imran, one of the eight officers wounded, said eight to 10 attackers, with faces hidden behind hoods, stormed into the compound and started shooting randomly.
They shouted "God is great," then shot the policemen one by one, said Imran, speaking from a hospital bed.
The gunmen then fled the scene.
Ahsanullah Ahsan, spokesman for the Pakistani Taliban, claimed responsibility for the attack.
Speaking to the Associated Press news agency from an undisclosed location, Ahsan said Thursday's attack was revenge for the police torture of the group's fighters in prison.
The police who were attacked were recruited from northwest Khyber Pakhtunkhwa province, a one-time base for the Taliban, and were brought to Lahore for training, said Habibur Rehman, Punjab provincial police chief.
Pakistan is battling armed groups in its northwest tribal region, but attacks in Punjab and Lahore - the country's political heartland - have been rare in recent months.
In a statement issued on Thursday, the Pakistani Taliban warned of "more severe attacks in Pakistan which we have already planned and are executing".
The group identified Thursday's raid as part of a "chain of attacks" that began in Gujrat.
On Monday, gunmen shot dead seven security personnel at an army camp less than 150km southeast of Islamabad, again arriving by motorbike, opening fire and then fleeing.