ACARIGUA, Venezuela (Reuters) - Twenty-nine detainees were killed and 19 police officers were wounded in a confrontation in a cellblock in central Venezuela in what a state official called a failed escape attempt, but human rights groups described as a massacre.

The incident took place in the town of Acarigua in a municipal police cellblock in the central state of Portuguesa.

“There was an attempted escape and a fight broke out among(rival) gangs,” Portuguesa Citizen Security Secretary Oscar Valero told reporters. “With police intervention to prevent the escape, well, there were 29 deaths,” he said, adding that some 355 people were being held in the cellblock.

Detainees detonated three grenades, which wounded 19 police officers, he said. Venezuela’s Information Ministry did not immediately reply to a request for comment.

Human rights groups questioned the official version of the events.

“How is it that there was a confrontation between prisoners and police, but there are only dead prisoners?” Humberto Prado of the Venezuelan Prisons Observatory said in a telephone interview. “And if the prisoners had weapons, how did those weapons get in?”

Detainees for several days had been demanding that government ombudsmen help them avoid being transferred to distant prisons where they would not be able to receive visits from relatives, Prado said.

Authorities entered the cell block to carry out searches and remove visiting women when violence broke out, Prado said, estimating the facility in fact held some 540 inmates.

Police cellblocks in Venezuela are meant to hold citizens for 48 hours while they face formal charges. But detained citizens can spend months or even years in such facilities because prisons are too overcrowded to receive them and because of chronic delays in basic criminal justice proceedings required to indict them.

In 2018, a riot that led to a fire in a police cellblock in the central city of Valencia killed 68 people, including two women who were visiting.

Carlos Nieto of human rights group A Window to Freedom said the country has around 500 cellblocks with capacity to hold around 7,000 people that currently have nearly 55,000 detainees in custody.