Updated

Militants attacked a prison in northwest Pakistan late Monday armed with mortars and are locked in a gunfight with police and security forces, officials said.

The attack is under way at Central Prison in Dera Ismail Khan city, close to the lawless tribal regions bordering Afghanistan where Taliban and Al-Qaeda-linked insurgents are active.

"Militants have attacked the Central Prison. They are heavily armed and firing mortar shells," district police chief Sohail Khalid told AFP.

The ambush appears to be an attempt to free several militants who are held in the jail, said a security official on the condition of anonymity.

Residents in Dera Ismail Khan reported hearing loud blasts and gunfire, and said the electricity supply to several parts of the city had been suspended.

It was not immediately possible to confirm a jailbreak or any casualties, said Khalid, adding that extra police and paramilitary forces had been called into the area.

"The situation is not clear as intense firing is going on between militants and security forces," he said.

A local police official said he saw militants carrying rocket launchers and firing at the jail.

"Militants were firing rockets at jail and I also heard gunfire from inside the building," the official said on condition of anonymity.

He said that security forces had cordoned off the area around the prison where intelligence agency offices and the police headquarters are located.

Shaukat Yousafzai, spokesman for northwestern Khyber Pakhtunkhwa provincial government, confirmed the attack but said he had no information about casualties.

"The army has been called in to counter the militant attack," Yousafzai said.