Brazil's hideously overcrowded prisons see frequent outbursts of extreme violence and murders, and are infamous for being in the stranglehold of sophisticated criminal gangs that are capable of orchestrating anything from synchronized mutinies to contract killings from inside their cells.
The country's prison population is so vast and the authorities' ability to contain it so stretched, the lack of security at some penitentiaries is almost surreal.
This week it emerged that inmates at a jail in Piauí, one of Brazil's most impoverished states, are regularly slipping out to go on late-night crime sprees, robbing locals of a wish list of items banned in prison.
The felons steal meat, beer, knives, and coveted cellphones from the surrounding area and bring the loot back to their cells at the Major César de Oliveira penitentiary, located 25 miles outside of state capital Teresina. Brazilian news site UOL reported that 40 cans of beer were found in one cell during an inspection.
Around 50 of the prison's 220 inmates are serving "semi-open" sentences, under which they are permitted to leave prison during the day to work but must be confined at night. The system's proponents say the approach offers prisoners a better chance at rehabilitation, but abuse of the arrangement suggests the paucity of oversight has more to do with a lack of resources.
'Brazil's prison population is the fourth biggest in the world, and is growing faster than any other country.'
Kleiton Holanda, union director for the military police officers who guard the prison, told UOL that inmates regularly leave by a side entrance: "There is often a car or motorcycle staking out the area, allowing them to leave and commit these crimes — all arranged by cell phone."
With damaged barbed wire fences surrounding the compound and only four guards per shift, the porous security set-up hasn't been hard to outwit.
The government has announced that it intends to curb the inmates' criminal activities by doubling the number of guards and laying down fresh barbed wire — but it will take more than this to fix Brazil's prisons and manage their extreme overcrowding. The theft of meat and beer from locals is the least of the system's problems.
According to the Brazilian Bar Association (OAB), there are now around 680,000 people in the country's jails, which are designed to hold 300,000. A decade ago, Brazil had around 270,000 people in custody. Today, São Paulo state alone holds this many prisoners.
"Brazil's prison population is the fourth biggest in the world, and is growing faster than any other country," Sandra Carvalho, general coordinator at Brazilian human rights organization Justiça Global, told VICE News. "We will never have enough capacity if we continue jailing people at this rate."
Extreme cases of overcrowding are seen at places like the Curado penitentiary complex in Pernambuco, where upwards of 7,000 prisoners are being held in a facility built to hold no more than 1,800.
"Obviously, under those conditions there is scant chance of rehabilitation: 70 percent re-offend," Carvalho said, noting that the majority of prisoners are young, black, and poor.
Curado was the site of a major rebellion in January in which prisoners complained of overcrowding and long waits for trial proceedings. At least two inmates and one military police sergeant were killed in the first two days of the riot.
Some analysts believe the solution is to build more prisons, but Adilson Rocha, president of the OAB's National Prison Coordination, told VICE News that this view neglects the wasteful state of Brazilian incarceration.
"Brazil simply jails too many people who remain there unnecessarily, stuck in an inefficient judicial system while awaiting conviction," he said. "For each 100 people put in jail, 70 leave within three months. Obviously these people aren't a danger to society if they are let out so quickly."
Indeed, a report by the Inter-American Commission on Human Rights published in September found that roughly 40 percent of those held in the country's prisons are waiting for their cases to be decided.
Rocha said that "chaotic prison management" is at the heart of the system's problems.
"Many states, even Minas Gerais" — Brazil's second most-populous state — "don't even have a state-level representative for the prison system," he noted. "It means that budgets aren't drawn up properly, and funds end up being returned to central coffers."
The lack of funds and the high number of people being jailed forces the authorities to allocate every available inch of space to locking people up. An inadvertent result of this overload is that criminal gangs now rule many of Brazil's jails virtually unchallenged.
The most infamous gang is the PCC — Primeiro Comando da Capital, or First Command of the Capital — which the Justice Ministry says is active in prisons in 22 states. It gained international notoriety in 2013 when it led a campaign of revenge killings against police in São Paulo, killing some 100 people.
Angry, terrified, and desperate for relief from the conditions behind bars, prisoners in many of Brazil's prisons regularly spark riots and stage hostage-takings. The disturbances can go on for weeks, and prisoners have even seized visiting relatives in staged hostage situations to draw attention to their plight.
Demands have ranged from relocation to less crowded jails and better security from gang violence, to better food and clothing and the removal of prison directors.
Rocha has seen some of the country's worst prisons firsthand, and regards riots less as senseless eruptions of violence than as legitimate cries for help from within a prison system on the brink of collapse.
"If there are riots happening, the prisoners are nearly always justified in their demands," he said.
Meanwhile, Brazil's mass incarceration problem could potentially get even worse: the country is now the closest it has ever been to passing a proposal, stuck in government for 21 years, that would reduce the age of criminal responsibility from 18 years to 16.
Carvalho and Rocha both agree that if the measure is passed, it will be the final nail in the coffin for a system that is already set to implode.
Follow Ben Tavener on Twitter: @BenTavener