At least 55 people have been killed in the north-east of Nigeria in co-ordinated attacks by the Boko Haram militant group, the Nigerian army has claimed.
It said 105 prisoners were freed in the pre-dawn raid in Bama, Borno state by the sect in a dawn raid.
Bama’s police station, military barracks and government buildings were burned to the ground, said the military and witnesses.
Correspondents say extremist attacks are common in the region but the scale of bloodshed makes this raid stand out.
Tuesday’s raid in the remote town went on for several hours, said Musa Sagir, a military spokesman based in Maiduguri, some 70km (44 miles) from Bama.
“Some of the gunmen attacked the military barracks but they were repelled. Ten of them were killed and two were arrested,” he told AFP news agency.
“But the gunmen broke into the prison, freeing 105 inmates, and killed all prison warders they could see except those who hid in a store where cooking utensils were kept,” he added.
Twenty-two police officers, 14 prison wardens, two soldiers and four civilians were among those killed along with 13 members of Boko Haram itself, he said.
Police and public buildings – reportedly including a magistrate’s court – were razed to the ground.
Boko Haram, as it is popularly known, has its roots in this region of Nigeria. It is fighting to overthrow the government and set up an Islamic state.
Late last month the military launched a raid to hunt down militants in Baga, also in Borno state, after Boko Haram militants attacked a military patrol.
Nearly 200 people died in the raid, and thousands of buildings were destroyed, leading to claims by rights groups that the military had used excessive force. The army put the number killed at 37.
Analysis ByWill Ross BBC News, Lagos
In late 2012 you could have argued that the military operation against the Islamist militants had diminished the threat. But not any more.
Coming on the back of other deadly attacks, this is probably the most significant strike against the state apparatus since the Kano bombings in January 2012. The army says it was the work of Boko Haram. If that is true, by targeting the police, army and a prison with such devastating effect, the group appears to be sending out the defiant message that it cannot be defeated by the state security forces. There are reports that the militants have acquired more powerful weapons.
The suggestion that some politicians are fuelling the conflict or even backing the Islamist extremists is not fading.
The current military offensive is not working. So what is the way forward? President Goodluck Jonathan appears to have put his faith in God and the unlikely prospect of all the Islamist militants accepting an amnesty. His predecessors have faced daunting security challenges but this one is on a different scale.
Nigeria Security Way Forward?… Meet Wole Soyinka, Doyin Okupe and Omoyele Sowore