* Armed gangs effectively controlled the prison -minister
* Prison system a growing problem for government
* Chavez has not been seen in public in seven weeks (Updates with official toll; adds quotes, details)
By Girish Gupta
URIBANA, Venezuela, Jan 27 (Reuters) - Venezuelan authorities transferred inmates out of a prison on Sunday following a bloody riot two days earlier that killed 58 people and again highlighted chaos in the country's jails.
It was the fourth high-profile incident in 18 months in a penal system that has experienced repeated fatal clashes and shootouts. Venezuela's prisons house three times the number of inmates they were designed to hold.
The violence broke out at the Uribana jail as cancer-stricken President Hugo Chavez continues receiving treatment in Cuba and Vice President Nicolas Maduro - the notional head of state - visited him in Havana then flew to a summit in Chile.
In surprisingly candid comments to state TV, Prisons Minister Iris Varela acknowledged that weapons-smuggling enabled by corrupt prison workers had let armed gangs effectively control the run-down facility, near the city of Barquisimeto in southwestern Venezuela.
"It was nearly impossible to operate a penitentiary here given the level of violence," Varela told a news conference. "This is part of the corruption of some officials. We have opened battle lines against them."
Varela said 2,000 male prisoners and 130 female prisoners were being transferred to other facilities, while 46 remained in hospital recovering from injuries.
The government did not provide its own official number of 58 dead until late on Sunday afternoon. A hospital official had earlier put the death toll at 61.
Television images showed the burnt remains of cells that had been burned by prisoners. Makeshift shacks with teetering roofs and exposed electrical wiring, built by inmates in the overcrowded prison, lay charred by the blaze.
Prisoners had been raising goats and chickens inside the grounds, Varela said, and had an extensive network of tunnels for escape and trafficking.
She said the inmate gangs had probably wanted to stay, most likely because of the ample opportunity for lucrative illicit business within the jail.
"The prisoners didn't escape from here en masse because they didn't want to," she said. "If all the men that were in here pushed the wall, they would have knocked it over."
INSPECTION TRIGGERED RIOT
On Friday, the authorities had attempted to carry out an inspection at Uribana targeting the gangs' weapons, but were unable to do so because of armed resistance, the minister said.
Searching through the wreckage on Sunday, officers found a hand grenade and the charred remains of an unidentified body, which was included in the official toll.
Earlier in the day, relatives gathered outside voiced anger at the lack of information about where inmates were being sent.
"We're suffering here, and the government is saying nothing," said Josefina Ramirez, 36, seeking information about her 25-year-old husband. "We want Chavez to come here to give us news. We want an answer."
Chavez has not been seen in public nor heard from in 45 days, an absence that has spurred criticism from opposition leaders that the country is effectively without a president. Allies insist he is fully carrying out his duties.
Maduro promised a full investigation of the incident just after returning to Venezuela from Havana on Saturday. Within hours, he left to meet with Latin American and European dignitaries at a summit in Chile.
Brazilian President Dilma Rousseff scrapped her agenda at that summit and returned home after a nightclub fire killed at least 233 people early on Sunday.
Varela had earlier blamed opposition media for reporting the search, which she said triggered the violence. Prisons have been a growing headache for the Chavez administration.
Inmates refusing to be transferred out of a Caracas prison battled security forces in May for days as smoke rose above the compound and shots rang out. Chavez later said he called from Cuba, where he was receiving treatment, and spoke with one of the inmates to help negotiate an end to the standoff.
Local media last year published a story about a nightclub called Disco Tokio that held a Mother's Day party that featured musical groups flown in from Colombia and Puerto Rico. The club was located inside the Tocoron jail.
An online animated series about jail violence called "Jail or Hell," produced by a former inmate, has drawn a following among Venezuelans captivated by the chaos of the prisons. (Writing by Brian Ellsworth; Editing by Daniel Wallis and Mohammad Zargham)