* Attack underscores security concerns for new government
* At least 12 killed, 250 prisoners escaped
* Thirty top militants whisked away to lawless tribal areas
In an operation carried out with military-like precision, Taliban fighters disguised as police and armed with bombs broke 250 prisoners out of a Pakistan jail on Tuesday with the help of what appeared to be insider informants.
The attack in the city of Dera Ismail Khan showed the ability of the al Qaeda-linked Pakistani Taliban to strike at the heart of Pakistan's heavily guarded prison system and walk away with dozens of senior Taliban fighters and commanders.
The overnight assault on the Central Prison took place despite reports that regional officials had received intelligence days, if not weeks, ago suggesting such an attack was imminent.
Officials blamed a combination of negligence and lack of communication among Pakistan's many security agencies, but some suggested there may have been a degree of insider help.
Just hours before the attack, army and police units had met at the jail to discuss security, one source said on condition of anonymity due to the sensitivity of the matter.
"It is very difficult to attack such a place without proper information or contacts," said the police source, adding that some prisoners were suspected to have been in touch with the Taliban by mobile phones provided by sympathetic wardens.
"They are corrupt, lazy and unprofessional. And the militants may have supporters in the city."
Another senior official in the provincial capital of Peshawar said only about 70 of the 200 prison guards who were meant to be on duty were present that night.
"Most policemen ran for their lives once the attack started, leaving their weapons behind," the official told Reuters. "They could have easily killed some of the attackers but they even gave up their own guns, providing the attackers with more ammo."
The attack came a year after a similar mass jailbreak in the northern town of Bannu which Taliban militants said was carried out with inside help from prison guards. An inquiry later found there were far fewer guards on duty than there should have been.
A senior Taliban official told Reuters separately the latest attack was masterminded by Adnan Rashid, a Taliban commander who was himself freed in last year's prison break.
"LOCKS ARE BROKEN!"
This time, Pakistani Taliban said they had sent a squad of 100 fighters and seven suicide bombers on a mission to free some of their top leaders, and they said they released 250 prisoners - a number roughly matched by Pakistani authorities.
Fighting continued into the early hours of Tuesday, with explosions and machine gunfire rattling the city in Khyber Pakhtunkhwa province, on the edge of Pakistan's lawless ethnic Pashtun tribal regions bordering Afghanistan.
As the attack unfolded, gunmen blew up electricity lines to the prison and detonated bombs to breach the outer walls.
They fought their way inside using rocket-propelled grenades and machine guns, and called the names of Taliban prisoners they wanted to release through loud speakers.
Once inside, attackers shot open most of the locks and used bombs to blast their way deep into the prison, shouting "All the locks are broken! Those who want to escape, now is your chance," prison officials who were there at the time told Reuters.
Gunmen also took over a nearby house and hospital, holding the residents hostage as they fired on police from the rooftops and laid ambushes for reinforcements.
Describing the chaos that gripped the town that night, police Constable Gul Mohammed said he had been rushing to the scene when he was confronted by two boys holding rifles.
"They told me to stop," he told Reuters. "I told them I am a policeman, and that's when they opened fire." He added that he was shot three times.
At least 12 people were killed, officials said, including five policemen and four prisoners from the minority Shi'ite branch of Islam. Their throats were slashed by gunmen, officials said. The Taliban are mostly majority Sunni Muslims.
The carefully planned attack underlines the growing capabilities of the Pakistani branch of the Taliban, an offshoot of the insurgents of the same name in neighbouring Afghanistan.
Despite promising peace talks with the insurgents during an election campaign this year, Prime Minister Nawaz Sharif appears to be accepting the use of military force may be unavoidable after a series of high-profile attacks.
The senior security source in Peshawar said an army intelligence unit had sent a "red alert" to the regional interior department four days ago warning of a "huge attack of Dera Ismail Khan and surrounding areas".
Another security official in Peshawar said the warning was sent two weeks ago, saying telephone call intercepts indicated the militants had been planning a jail break and that interrogations of captured fighters confirmed it.
Mushtaq Jadoon, the town's civil commissioner, said the 253 escaped prisoners included 30 top militants and six people on death row. Those who escaped are believed to have been whisked away to nearby South and North Waziristan, areas where the Taliban has strongholds.
Asked about the possibility of an insider job, an Interior Ministry spokesman said there had been warnings of a big attack in the region for some time.
"There have been complaints that prisoners have cell phones there," the spokesman said. "I presume there could have been something from inside, some sort of intelligence from inside."
Security forces said they had imposed a curfew on the city and the gun battle was over by dawn. A Reuters reporter at the scene saw security forces and bomb disposal squads conducting searches amid ruined walls pocked with bullet holes.
The audacity of the latest assault raised embarrassing questions over how well-prepared security forces are following a series of high-profile attacks, and underscores the challenges facing the new government in combating the militancy.
The heavily guarded jail at Dera Ismail Khan houses about 5,000 prisoners. About 250 are Taliban and members of banned sectarian groups such as Lashkar-e-Jhangvi, a Sunni militant group that has killed hundreds of Shi'ites this year.
"It was a heavily guarded jail and considered one of the most protected prisons in the province," said a senior government official in Peshawar. "We will investigate how the militants managed to come from the distant tribal areas and break into the jail and take away their people."
The attack came the day lawmakers were due to choose a new president in a largely ceremonial vote, and two days before a major Shi'ite festival which security officials have warned could be attacked.