The state's top public safety official said several dozen inmates at a maximum-security prison armed themselves and were "getting ready for war" during a disturbance at the facility.

Secretary of Public Safety Daniel Bennett told reporters Tuesday that the incident began with a fight Monday between two inmates at the Souza-Baranowski Correctional Center and quickly escalated when 47 inmates refused orders to return to their cells.

The riot ended about three hours later. Bennett credited a decision to remove corrections officers from the unit when the violence began as preventing any serious injuries.

Bennett said security video shows inmates -- including some serving life sentences for murder — smashing furniture, computers and fire extinguishers to fashion makeshift knives and other weapons.

He said they intended to attack corrections officers.

"You had 47 inmates ready to take on those COs and they had armed themselves with knives, bats and iron pipes, and they were going to go after the COs," Bennett said.

(Courtesy Department of Correction)

The inmates gave up after police flooded the unit with pepper spray.

"The pepper spray was significant enough that the inmates started to give themselves up," Bennett said.

Gov. Charlie Baker said he was pleased that no one was seriously injured in the disturbance.

The prison remained in lockdown on Tuesday, officials said.

According to the Department of Correction, the inmates involved in Monday's incident will be housed in "segregation units" and will face disciplinary actions and potential criminal charges.

With reporting by The Associated Press, State House News Service and the WBUR Newsroom