Staff shortages are making it harder to tackle Islamic radicalisation in England's prisons, the former head of the National Counter Terrorism Security Office has warned.
Chris Phillips said shortages meant extremists were not properly monitored, enabling them to recruit others.
A parliamentary report has said jail safety was compromised by staff cuts.
Justice Secretary Chris Grayling rejected the claim and said a "very careful watch" was kept on the issue.
"Prison overcrowding is at virtually its lowest level for a decade, and we have increased spending on measures to prevent radicalisation," he said.
"We will never be complacent about the issue."
Mr Grayling said he had found "no evidence" that Mr Phillips' claim was correct, adding that the former detective chief inspector had left the civil service four years ago.
There are more than 12,000 Muslims in jails across England and Wales and the latest official data shows that more than 100 Muslims are in jail for terrorism offences in Great Britain.
The worry particularly concerns converts to Islam, as research from the former chief inspector of prisons, Dame Anne Owers, suggests they are more vulnerable to extremism.
But her report also said suspicion of Muslim prisoners could be both unfair and counter-productive, fuelling resentment and causing even more trouble.
'Haystack of extremists'
Mr Phillips, who used to lead the National Counter Terrorism Security Office, a police unit that works closely with the government on its counter-terrorism strategy, said: "What we have actually is a prison population that's growing.
"We have less officers generally in prisons than ever before and we also have less police officers to deal with them, so what we have is a growing haystack of extremists where we still have to find the single needle that's going to go off and do something really nasty.
"But of course we've got less people to go and look for them as well so it's a really difficult thing for the police service and prison service to deal with."
Home Secretary Theresa May rejected the claim that staff shortages were hindering efforts to stop Islamic radicalisation in prisons, adding that the government was looking at "and continue to look at" preventative measures.
Mrs May has already said she wants new "extremism officer" roles in prisons to deal with radicalisation.
And the government has said all high-security jails have units who work with the security services to root out extremism. It also said there were faith-based interventions, led by a team of expert imams.
An ex-prisoner's view
Ex-prisoner John Shelly said: "Over the last few years there's been a real sort of noticeable change of people becoming radicalised and getting themselves involved in violent situations - and being coerced into doing that by some of what you might call the more prominent Muslims that are inside for various offences."
He spent time in more than 40 jails including HMP Whitemoor, a prison with a large Muslim population. Last year, chief inspector of prisons Nick Hardwick said some of its inmates who had been convicted of terrorism offences were trying to influence and pressurise others.
Mr Shelly, who was released from prison a few months ago after serving a 15-year sentence for armed robbery, said prisoners would often "join the extremists" because they were promised protection.
He claims to have seen prisoners plotting acts of terror as well as endorsing groups such as Islamic State and al-Qaeda.
He said: "Extremism - it's grown and grown by the day and they've found themselves in a situation where they can't separate anyone because wherever they separate them to, they're just mixing them with other people who have the same view and same sort of message."
Mr Phillips said: "The answer is to get into the prisons and to make sure the most susceptible people are kept away from those that might turn those into extremists and, at this moment, we cannot even keep drugs out of prison, we can't keep mobile phones out of prison, so clearly there is not enough staff to do that."
Muslim former prisoner Hassan said he had been unfairly discriminated against, however.
"I was inside for 14 years, and a lot of people became Muslim through me," he said. "You're looked at as, 'Oh, a lot of people are becoming Muslim because of this man, he must be recruiting,' and it's far, far from the truth. They think you're a radical or a fundamentalist."
Stephen O'Connell, president of the Prison Governors' Association, told the BBC that the threat from radicalisation in prisons was "real" but he said he was not aware that it had got any worse over the last year because of staffing changes.
"I understand the correlation between staff numbers and prisoner numbers but when it comes to dealing with extremists, we are talking about a small number of prisoners with some very dedicated resources to actually managing those," he said.
The Justice Select Committee recently criticised the government for cutting the number of prison officers by almost 30%, a reduction of 12,530 staff, between 31 March 2010 and 30 June 2014.
The committee's report also said the prisoner-to-staff ratio rose from 3.8 in September 2010 to 4.9 in September 2014.
It claims that this has led to a significant deterioration in safety - with fewer staff to monitor inmates.
And former Lord Chief Justice Lord Woolf recently said that Britain was heading for a crisis within prisons because of overcrowding and staff shortages.
The government denies that.
But the explosive mix of radicalisation, fear over discrimination and staffing pressures could spell even greater trouble inside the country's jails.
The latest prison population statistics from the Ministry of Justice show there were 85,681 people in jail in the week ending 27 March, up from 85,252 in the same period last year.