One in 25 prisoners across England and Wales tested positive for opiates such as heroin in 2007, rising to one in six in some jails, government figures show.
Ministers say overall drug use is down in prisons
A three-month study involving random testing found the most opiate abuse at Featherstone prison, Wolverhampton, where 16.7% of inmates tested positive.
The overall level of positive opiate tests among inmates in 139 jails was 4.2%, with 4% positive for cannabis.
The Ministry of Justice said the use of drugs had fallen since 1996.
The second highest level of opiate-taking was at the 350-inmate Erlestoke prison, in rural Wiltshire, where 16.1% of inmates tested positive.
The testing found 38 prisons in England and Wales were clear of any positive opiate tests.
A department spokesman said mandatory random tests showed use of all drugs was down from 24.4% in 1996/7 to 8.8% in 2006/7.
Other jails with the highest opiate levels were Peterborough's male prison, with 11.5%, Lowdham Grange, near Nottingham, with 10.6%, Lincoln, with 10.4% and Altcourse, in Liverpool, with 10.2%.
Cannabis was found in 16% of prisoners at both Buckley Hall, in Rochdale, Greater Manchester, and Thorn Cross, near Warrington, Cheshire, and in 14% of inmates at Coldingley, Surrey.
The figures were released as ministers announced testing for opiate substitute buprenorphine - also known as subutex - will be introduced at all prisons in England and Wales from next month.
The survey focused on buprenorphine, finding positive tests at 63 jails.
More than one in five inmates at Holme House jail, in Stockton-on-Tees, tested positive for the drug in random tests, with five other jails showing levels of between 11% and 16.5%.
Justice minister David Hanson said misuse of the drug had grown in the last 10 years and it presented a new challenge for prisons.
However, he said this did not detract from their "considerable achievement" in reducing the supply of drugs in the same period.
He added that a review of how drug supply to prisons could be disrupted was under way and would be completed by May.
Liberal Democrat justice spokesman David Howarth said: "The fact that only one in four prisons were clear of positive opiate tests demonstrates just how much of a problem drug abuse is.
"Prisons are failing in their duty to prisoners and society when they fail to prevent drug misuse among inmates."
Juliet Lyon, director of the Prison Reform Trust, said greater use by courts of drug rehabilitation in the community was needed as well as more effective limitations on drug supply inside jails.
She said: "For people who have served a sentence, it is essential support and treatment doesn't stop once they walk out of the prison gate."