Armed security forces were deployed to restore order at the prison
Two prisoners have been shot dead during an attempted jail break in the northern Nigerian city of Kaduna, officials say.
The BBC's Nurah Mohammed in Kaduna said he saw several injured prisoners and one wounded prison guard being taken to a nearby infirmary.
Nigeria's controller general of prisons said inmates burned down the prison workshop and another building.
This is the second attempted jail-break in Kaduna in the past few months.
There were reports of shooting and a loud explosion, and security forces surrounded the jail in an attempt to restore order.
The controller general confirmed earlier reports of the two deaths and said 39 had been wounded.
But our correspondent says people working inside the prison told him there were more than 50 injured, some quite seriously.
The controller general blamed the attempted jail-break on remand prisoners who were frustrated that their cases had not come to trial.
However, the police commissioner said the riot had been caused by the transfer of a popular prisoner.
He explained that when an inmate called Reverend King, who was awaiting a death sentence, was moved to another prison, inmates thought he had been executed and went on the rampage.
The commissioner confirmed that Mr King is safe and had been transferred to another jail in Kaduna.
Officials also said order had been restored at the prison, the inmates have been returned to their cells and that no-one escaped during the disturbance.
Prisoners in Kaduna have complained about overcrowding and poor treatment.