The director of a crisis-hit private jail has left his job amid claims that warders are struggling to control the high-security prison.

Ian Whitehead resigned from his role at HMP Addiewell on Friday – days after prisoners staged a protest at ­conditions caused by a staff ­shortage.

A female officer quit her job on Tuesday after failing a drugs test. Five trainee officers also left their jobs in October after failing drug tests when cocaine was detected.

The West Lothian jail – ­managed by Sodexo Justice ­Services – has been hit by ­problems leading to a prisoner revolt.

We revealed last week how low staff numbers had led to prisoners being kept in cells up to 22 hours.

Inmates have set two cells on fire and some refused to carry out duties, including ­serving food at meal times, in protest.

Management have had to bring in officers from two private jails in England – HMP ­Northumbria in Morpeth and HMP Forest Bank in Salford, near Manchester – as auxiliary staff.

Whitehead was made governor of Barlinnie Prison in 2014 but left in 2016 to go to Addiewell.

He has been replaced by Emma Stuart on a temporary basis.

Sodexo has admitted the jail was around 47 officers short.

A jail insider said: “The place is a joke at the moment.

“There was a protest in one of the recreation halls a couple of days ago when inmates refused to go back to their cells.

“Staff tried to herd them out but ended up getting chased back. Everyone eventually went back but only when they decided.

“The prison officers are ­relying on the inmates toeing the line. But there would be a big problem if they didn’t – the staff would lose control.”

HMP Addiewell is badly understaffed

An Addiewell spokesman said: “We can confirm a prison officer resigned on Tuesday due to not meeting the high ­standards we require.

“We can also confirm that a small number of prison custody officers were brought in from HMP Northumberland and HMP Forest Bank to assist at HMP Addiewell. They weren’t involved in the direct management of ­prisoners and have since returned to their prisons.

“Ian Whitehead has decided to leave the company. Emma ­Stuart is ­acting ­director while we recruit a ­permanent ­successor.

“Short-term ­staffing issues have been resolved, and have been since last ­Sunday. The prison is running ­normally.”

Last month, almost 100 letters laced with a so-called ­zombie spice drug were ­intercepted at Addiewell. Two officers were ­suspended in July over claims they forgot to lock a ­cell, resulting in a prisoner being attacked.

In January, a report by HM Chief Inspector of Prisons for Scotland Wendy Sinclair-Gieben expressed concerns over staffing levels and the use of inexperienced staff. The report also said some inmates were being routinely locked up as long as 22 hours a day.

Liam Kerr, Scottish ­Conservative justice spokesman, said: “This is a very ­concerning ­situation. However the wider ­pressures of staffing, under­funding and overcrowding are across the prison estate.

“Prison officers have been ­operating under extreme pressure for years but this seems to be a significant escalation in chaos and staff issues.”

HMP Addiewell has been run by Sodexo since 2006 with the contract due to expire in 2034. It was built under the controversial private finance ­initiative and the contract will cost the taxpayer £995million.