Authorities have regained control of a Massachusetts prison after inmates allegedly refused to return to their cells Monday, prompting the evacuation of corrections officers.

Police responded to Souza-Baranowski Correctional Center in Shirley after the incident involving dozens of inmates in the P-1 housing unit.

State Department of Correction spokesman Christopher Fallon said the altercation started between two suspected gang members when the maximum-security prison crisis management team went into to a housing unit to try and diffuse the situation, another situation occurred and escalated into a riot.

Fallon said inmates started to create weapons and destroy property including fire extinguishers, computers and cameras used to monitor the inmates. He said the entire housing unit was completely damaged and calls it a total loss.

Personnel from the prison's special operations unit took control of the situation just after 8 p.m., according to the Massachusetts Department of Corrections.

The DOC said there were about 88 inmates in the housing unit during the time with 46 of them taking part in the riot.

Authorities said all the inmates will be taken into the general prison to be medically and psychologically evaluated. They will then be separated into different areas of the prison.

There were no serious injuries to staff members or inmates.

The prison is the same one where former New England Patriots star Aaron Hernandez is being held. It isn't clear whether his unit is the one affected.

Souza-Baranowski Correctional Center is a maximum-security prison with about 1,000 inmates. It is the newest state correctional facility in Massachusetts, having opened in 1998.