Thirteen Venezuelan prisoners who had been on a hunger strike over conditions have died after drinking a cocktail of prescription drugs and grain alcohol, according to the government.

Another 145 were being treated for poisoning after drinking the concoction on Wednesday, it said.

A nongovernmental organisation put the death toll as high as 21.

It was the latest tragic episode in a country with one of the mostly violent and dangerous penal systems in the world.

The prisoners at David Viloria Correction Centre in Venezuela's Lara state had been protesting since Tuesday over what they said were inhumane treatment and rights violations by prison officials.

The Prisons Ministry said inmates became violent, broke into the infirmary and guzzled a cocktail they made of grain alcohol, drugs used to treat epilepsy as well as antibiotics and tranquilisers.

A ministry statement said the deaths and injuries stemmed from "uncontrolled ingestion" of the mix of grain alcohol and those medications.

Experts appointed

Prosecutors named a team of experts to probe the incident.

The ministry statement said inmates first broke down walls and doors of their holding area, and then violently made their way into the infirmary.

"They assaulted the pharmacy and the workshops, proceeding to ingest a variety of medications," it said.

Venezuelan Prisons Watch, a non-governmental group, said earlier there were 17 dead at the prison in Lara state.

But four more, who also drank the dangerous mix, died after being transferred to a prison in the state of Maracay, Humberto Prado, director of Venezuelan Prisons Watch, said.

He said the condition of others who were transferred to other prisons was not immediately known.

Venezuela's prison system is one of the most violent anywhere.

Main prison problems

In the first half of this year 150 inmates died in prison riots, according to a recent report by Venezuelan Prisons Watch.

The main problems are overcrowding, dismal health conditions and malnourishment.

Starting in 2011, then President Hugo Chavez launched a programme to improve living conditions, disarm prisoners and speed up the backlogged court system.

His successor Nicolas Maduro has pressed ahead with the policy.

But in many cases jails are controlled by heavily armed gangs involved in frequent fighting.

As of the end of June 2014, the prison population was more than 55,000, while penal facilities have room for 19,000.

Sixty-five percent of those in jail are still awaiting trial.

Overnight on Tuesday a group of 41 inmates convicted of murder, kidnapping and robbery broke holes in the walls of their prison outside Caracas and escaped, prosecutors said in a statement.