Thousands of prison officers will be handed immediate pay rises of up to £5,000 in a bid to reverse a dangerous staffing crisis and prevent further riots.

Existing staff at 31 jails in England will see their salaries rise while potential new recruits will be tempted by higher starting pay of up to £29,500, Justice Secretary Liz Truss has announced.

The £12m move comes weeks after Ms Truss announced a national recruitment drive to add 2,500 officers as part of a wide-ranging shake-up of Britain’s prisons.

They are widely viewed as being in crisis – violent, overcrowded, understaffed and failing to cut reoffending through rehabilitation.

There has been growing criticism of savage cuts to prison officer numbers in the last Parliament, which has seen 7,000 posts disappear since 2010.

Chris Grayling, the former Justice Secretary, was targeted for getting rid of long-serving, experienced officers and replacing a fraction of them with young, cheaper staff with just a few weeks' training.

Justice Secretary Liz Truss (Ben Birchall/PA Wire)

There were riots at a number of prisons in the final weeks of last year, including Birmingham, Bedford, Swaleside, in Kent, and Lewes, in Sussex.

And figures earlier this month showed that almost a fifth of jails in England and Wales have a significant shortfall of frontline officers – making it harder to crack down on drugs and violence.

Governors have been forced to lock inmates up for longer and impose restricted regimes as a consequence, adding to tensions.

Now Ms Truss has promised that the new package will see pay improved for guards at jails where recruitment has proved most difficult.

The 31 prisons where annual pay will rise by between £3,000 and £5,000 include Pentonville, Wormwood Scrubs and Belmarsh, all in London.

The higher starting salaries also represent a £5,000 rise on the current level, the Ministry of Justice said.

BBC Panorama uncover 'chaos' in prison system

Ms Truss said: “Prison officers do a challenging and demanding job day in and day out.I want frontline staff to know that their work, experience and loyal service is valued.

“We also want to attract the best new talent into the service, ensuring we recruit and retain the leaders of the future.

“These hard-working, dedicated staff are key to delivering our ambitious reform agenda, and it is right that we offer them greater support as we move ever closer to transforming prisons into places of safety and reform.”

Conbody: The fitness firm run by former prisoners - In pictures Show all 7 1 /7 Conbody: The fitness firm run by former prisoners - In pictures Conbody: The fitness firm run by former prisoners - In pictures Coss Marte founded ConBody Conbody: The fitness firm run by former prisoners - In pictures Conbody: The fitness firm run by former prisoners - In pictures Conbody: The fitness firm run by former prisoners - In pictures Trainer Shane Ennover Conbody: The fitness firm run by former prisoners - In pictures Conbody: The fitness firm run by former prisoners - In pictures Trainers Shane Ennover, Coss Marte and Sultan Malik Conbody: The fitness firm run by former prisoners - In pictures Trainer Sultan Malik

As well as the announcement on pay, prison staff will also be given specialist training in mental health and self-harm prevention.

Steadily longer sentences handed down for certain categories of crime are seen as the main factor behind a doubling of the prison population, to roughly 85,000, over the past 20 years.

But Ms Truss has ruled out more lenient sentencing or a cap on prisoner numbers as a solution to the crisis – focusing instead on tougher community sentencing to cut the number of offenders entering jails.