A prison officer collapsed and convulsed on the floor after accidentally inhaling the synthetic cannabis substitute spice.

Widespread drug use has been uncovered at HMP Northumberland where it is claimed the inmates were, in effect, running the prison.

Undercover filming for the BBC's Panorama has revealed inmates threatening staff, guards left alone to control large numbers of prisoners and alarms that did not go off at the site, run by Sodexo Justice Services.

Reporter Joe Fenton said: "On my very first day, I was taken into a room with some of the other new recruits where we were shown a table covered in drugs. It was a massive find by prison staff—2.5kg of a drug called spice—a much stronger, cheaper, synthetic alternative to cannabis.

"Prisoners told officers this find had barely scratched the surface.

"It didn't take too long to realise that the inmates were, in effect, running this prison. I saw prisoners stumbling around drunk, others who were high on drugs and some struggling to cope with addiction.

"On a standard 10-hour shift, the demands from prisoners were endless.

"The work didn't stop from the moment we got there to the moment we left. You just can't work five or six days solid there—it ruins you and you don't feel like a person any more, you just exist."

Large quantities of drugs were stored in cupboards rather than hidden away, he said.

HMP Northumberland houses up to 1,348 male prisoners. Sodexo's website says the company's "vision" for the site was "to lead the way on the Government’s priority to create a working prison model".

A spokesman for Sodexo said: "We are proud of those staff at HMP Northumberland who do a professional job in such difficult circumstances.

"Security and the safety of our prisoners and staff are our top priority, which is why we have made significant investments in these two areas over and above the contract requirements.

"We continually review the staffing levels at the prison and have recruited an additional 37 staff above the funded headcount."

A Ministry of Justice spokeswoman said: "These are extremely serious allegations which are being urgently investigated.

"The Justice Secretary has been clear that levels of violence and self-harm in our prisons are too high which is why we are investing an extra £100m annually to boost the frontline by 2,500 officers.

"Every officer will be responsible for a case load of six offenders, making sure all prisoners get the support needed to quit drugs and get the education and training that will help turn their lives around.

"These are long-standing issues which will not be resolved in weeks or months but we are determined to make our prisons places of safety and reform.

"We have robust processes in place to closely monitor and manage private contractors and will not hesitate to take action when standards fall short."

2016 saw claims the prison system was in "total meltdown" after an alarming rise in the number of murders, sexual assaults and attempted hangings. Violence was close to double rates from 2010 before the Coalition government came to power and began controversial reforms.

And official figures revealed a record number of people killed themselves in prisons in England and Wales last year.

There were 354 deaths in custody in 2016, including 119 self-inflicted deaths. Self-harm incidents jumped by 23 per cent to 37,784—nearly 7,000 more than were recorded in the previous year.

In December a riot at HMP Birmingham, run by G4S, saw inmates take over four wings across 12 hours, reportedly burning records and throwing computers out of windows. The clash erupted following tensions over prison conditions and reports inmates were on near-constant "lock-down" due to a lack of prison staff and resources.