The incident began with a confrontation between security guards and the inmates, most of them serving death sentences, after they gained access to weapons and started shooting inside the prison.