Players warm up among mattresses and clothes hanging on lines. When they walk outside, they’re stopped at a metal door and frisked by armed guards. After a second metal door, they arrive on the pitch. Any slip over the sidelines is dangerous: the area is encircled by barbed wire. “We need to be calm, patient,” says one. “It’s our hot heads that got us in this place.” Outsiders are barred from the match. Once it ends, the players file back inside, saluted by hands that stretch into the corridor through steel bars. Their cell doors lock and screams of celebration echo through the prison.

Since 2012, this football tournament has been played every year inside Geraldo Beltrão, a maximum-security prison in João Pessoa, capital of Paraíba, Brazil. Each cell may form one team of five prisoners. After a week of continuous matches, each player on the winning team receives his prize: a box of food containing rice, beans and other goods, usually later sent to his family. The winning team also gets to play against prison guards, a match in which daily tensions sometimes creep into the pitch. “Bring a bag to carry all the goals home,” one inmate teases, and then quickly apologizes. Once the match is over, only one team will be armed.

This year’s winner was Cell 15. With 15 inmates, it could easily have formed three teams. But it can’t, because each cell can only field one squad, and it shouldn’t because the cells in Geraldo Beltrão are only supposed to hold seven people. Overcrowded prisons are the rule in Brazil, with the nation’s 400,000 inmates crammed into structures built to hold only 260,000. Last year, 83 suicides, 110 homicides and 769 other deaths were recorded in prisons countrywide, but the government has other priorities than improving life behind bars. Since 2008, only R$1.5 billion (US$670 million) has been invested in the national incarceration system, while in the same period, R$8 billion ($3.5 billion) of taxpayers’ money has gone to construct new stadiums for the World Cup.

In Manaus, state capital of Amazonas, stands a newly built, 42,000-capacity football arena that will likely be left vacant once the World Cup ends, and a 400 capacity prison that currently holds more than 1,000 detainees. So in September 2013, Sabino Marques, a judge in charge of monitoring the state’s prison system, proposed that, when the last footballer leaves the locker room, the stadium be used as a temporary detention center. It’s just one among many opinions aired in the national debate about Brazil’s World Cup spending. Even inside Geraldo Beltrão, pragmatism struggles with football pride. “All the money being spent on the World Cup is an investment in the wrong place,” says Alex Herculano, 32, an inmate who plays as winger, “but the national team is good; I think we are going to win.”