Prison officers who stopped hundreds of rioting inmates from taking over an entire jail have been hailed as “heroic”.

Last month prisoners across four wings of HMP Birmingham, run by security firm G4S, wreaked havoc, causing an estimated £2 million of damage.

More than 500 prisoners, a third of the jail’s population, were shipped out of what is one of the country’s largest prisons following the 12-hour riot, but are yet to return.

As details emerge over the disturbance, the “brave” actions of a number of staff members have been praised.

Once inmates had control of the keys, sources told the Press Association a guard ran around the perimeter of N and P wings, double locking the doors.

Prisoners smashed their way out of the block, but 16 staff prevented prisoners from accessing the rest of the jail by guarding a gate for 90 minutes.

Fires were started, the gate was rammed with a trolley, and staff were pelted with missiles and paint.

Inmates also accessed wings L and M, and an injured prisoner was placed in front of the gate. Most of the damage was caused to wings N and P, it is understood.

Rodger Lawrence, chairman of the Birmingham prison and independent monitoring board, said he watched events unfold on CCTV in the command suite.

There was a “snatch squad ready to go in” to retrieve the injured prisoner, but every time this was about to happen the prisoners became “more aggressive”, he said

“There was then a feeling that he was used as a bait, so that once the gates were open and the snatch squad was in, they would flood out into the rest of the prison,” he added.

He said it was a “quite stressful and difficult” situation, with prisoners also building bonfires, throwing paint and other objects.

Mr Lawrence added: “To hold it (the gate) and stop the prison being more taken over than it actually was was really very heroic, especially the person who double locked everywhere.

“That was a significant key moment in making sure things didn’t get worse than they already had.”

Investigations are now being carried out by the Ministry of Justice and West Midlands Police.

Prisons minister Sam Gyimah said he was “incredibly proud” of the officers at HMP Birmingham and those who helped resolve the disturbance.

“I visited the prison shortly afterwards and saw first-hand the impact it had – not just the considerable damage to the prison building but the impact it had on the staff involved,” he said.

“Their acts of bravery that day are just another reminder of the vital work that dedicated prison officers do to help keep the public safe and I would like to pay tribute to all our officers for their commitment, passion and courage.”

Mr Gyimah said he and Justice Secretary Liz Truss are committed to “making prisons places of safety and reform” – with a major recruitment drive for 2,500 extra prison officers under way – but said that the “long-standing challenges” in the prison estate “cannot be fixed overnight”.

New security measures to “tackle drones, phones and drugs, which undermine safety” are also being implemented, he said.

G4S managing director Jerry Petherick said the firm was working with police to help “bring the ringleaders to justice” and with the Ministry of Justice investigation team to understand what happened and the events leading up to the disturbance.

“What has become clear is that our prison custody officers at HMP Birmingham, supported by colleagues from across the country, faced down determined aggression with incredible courage, resilience and professionalism,” he said.

“Our staff and their families are being offered support to rebuild shaken confidence where required and we are making the investment needed to ensure the four damaged wings can be brought back into service as soon as possible.

“As the dust has settled, many examples of unquestionable bravery and individual acts of heroism have come to light and the team, drawing on their substantial experience and knowledge, continues to show great strength in their resolve to bounce back and recover.”

:: Two men have now been charged in relation to the disturbance on December 16.