Riot police was deployed to a prison in Bedford to deal with major unrest, as prison guards reportedly had to seek shelter.

UPDATE: The riot has been “successfully resolved,” following police intervention, a spokesman for the local Prison Service said.

Update: The incident at HMP Bedford has been resolved. The Prison Service will carry out a full investigation — Bedfordshire Police (@bedspolice) November 6, 2016

Up to 200 inmates were reportedly involved in the unrest at Her Majesty’s Prison (HMP) Bedford, which started at around 5 p.m. local time.

POA say could be up to 200 inmates involved in HMP Bedford unrest. Some guards withdrawn to "safe place" as riot-trained officers deployed. — Scott D'Arcy (@DArcysj) November 6, 2016

The rioting inmates reportedly managed to occupy two prison wings by the time police intervened.

"There's been a serious incident which has resulted in two wings being taken over by prisoners," a spokesman for the Prison Officers Association (POA) told Reuters, adding that “prison officers from all over the country” were being dispatched to tackle the crisis.

“We are clear that prisoners who behave in this way will be punished and could spend significantly longer behind bars,” the BBC reported citing Prison Service spokesman.

We're currently working alongside partner agencies to assist HMP Bedford following reports of unrest within the prison earlier today — Bedfordshire Police (@bedspolice) November 6, 2016

Prisoners allegedly stormed a guard’s office and started minor fires inside the building, Bedford Today reported.

We are on standby outside Bedford Prison, no indications of any fires inside — Beds Fire and Rescue (@BedsFire) 6 ноября 2016 г.

However, Bedfordshire Fire and Rescue Service, which has been on standby at the facility, said no signs of fire could be seen.

Meanwhile, eyewitnesses outside the prison have reported police actively storming the building, with sounds of loud explosions going off at the facility.

#bedfordprison lots of loud explosions just now. — Mark Jeremy (@JeremyGoodband) November 6, 2016

Loud bangs sound fainter which may indicate police moving through building #bedfordprisonpic.twitter.com/5xPvOGd3ya — Olga Norford (@Citizen_Editor) November 6, 2016

A video has emerged on Twitter allegedly showing the mayhem filmed from inside the prison, with dozens of inmates apparently on the loose and yelling loudly.

Some of the prisoners were allegedly wielding knives and blades, Bedford Today reported.

The riot comes just two months after a report on the Category B prison conducted by the Chief Inspector of Prisons revealed many serious shortcomings. The survey found it was twice as easy for inmates to get drugs since the previous inspection in February 2014. The number of prisoners with a drug problem has respectively jumped from 4 percent to 14 percent.

The report also described the living conditions in the prison as “poor,” noting that inmates are forced to live in “crowded and cramped” conditions.

Apparently trouble in Bedford prison. Was terrible conditions in Bedford that led John Howard to launch prison reform crusade 200 years ago. — Frances Crook (@francescrook) November 6, 2016

Meanwhile, critics said they were not surprised by the rioting, given the prison’s troubling state of affairs.

Frances Cook, CEO of the charity Howard League for Penal Reform, tweeted there was “apparently trouble” in Bedford prison, recalling that the poor state of the same city’s jail actually contributed to penal reform in the 18th century.

“Was terrible conditions in Bedford that led John Howard to launch prison reform crusade 200 years ago,” she tweeted. Howard is known as the first English prison reformer who also served as a sheriff of Bedfordshire and who used to inspect the prison.

Earlier, Cook wondered on Twitter if “things have reverted” to the state of 1780s.

Given the reports about Bedford prison conditions it's not surprising there's a riot. Treat people like animals and they'll behave like them — Felicity Pepper (@probablyflick) November 6, 2016

Some others commenting on social media were even more direct.

“Treat people like animals and they'll behave like them,” Felicity Pepper wrote on Twitter.