The attack in Potiskum, the commercial capital of Yobe state, came as Shia Muslims marked Ashura, the anniversary of the death of Hussein, the grandson of the Prophet Mohammed.
The prison break saw armed gunmen use dynamite to blast open the detention facility in central Kogi state late yesterday, more than two years after Boko Haram launched an attack at the same facility.
Meanwhile in Adamawa state, also northeast Nigeria, tens of thousands of people fled their homes to refugee camps after the militants seized control of the commercial hub of Mubi.
The group's leader, Abubakar Shekau, on Friday dismissed the government's assertion of talks and an end to hostilities as "a lie".
More From This Section
He also claimed that the 219 schoolgirls kidnapped in mid-April, whose plight caught world attention, had all converted to Islam and been "married off".
In Potiskum, police and eye-witnesses said a bomb went off 10 metres (32 feet) from a seminary where Shia worshippers had gathered for the Ashura festival after visiting the local emir's palace.
Fifty people were also injured, he said, adding that several others died when troops who deployed to the scene opened fire. There was no immediate response from the military.
Potiskum is the economic capital of Yobe, which with Borno and Adamawa states have been under emergency rule since May of last year because of the insurgency.
The area has seen repeated violence, including attacks on the minority Shiite community.
In July, four Shiites were killed in a bomb attack blamed on the Sunni Islamists of Boko Haram at an open-air mosque in the Dogo Tebo area of the city.